Skip to content

Commit

Permalink
Fallback layer avoid calling SetComputeRoot32BitConstants with no data (
Browse files Browse the repository at this point in the history
microsoft#800)

If AccelerationStructuresEntries is empty, don't call SetComputeRoot32BitConstants
  • Loading branch information
HaydnTrigg authored Oct 12, 2022
1 parent 1f7da32 commit b6031f6
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,11 @@ namespace FallbackLayer
AccelerationStructuresEntries[entriesAdded++] = entry.second;
}

pCommandList->SetComputeRoot32BitConstants(
m_patchRootSignatureParameterStart + AccelerationStructuresList, (UINT)(AccelerationStructuresEntries.size() * (SizeOfInUint32(*AccelerationStructuresEntries.data()))), AccelerationStructuresEntries.data(), 0);
if (!AccelerationStructuresEntries.empty())
{
pCommandList->SetComputeRoot32BitConstants(
m_patchRootSignatureParameterStart + AccelerationStructuresList, (UINT)(AccelerationStructuresEntries.size() * (SizeOfInUint32(*AccelerationStructuresEntries.data()))), AccelerationStructuresEntries.data(), 0);
}

#ifdef DEBUG
m_pPredispatchCallback(pCommandList, m_patchRootSignatureParameterStart);
Expand Down

0 comments on commit b6031f6

Please sign in to comment.