Skip to content

Commit 1c02a41

Browse files
ResourceSignatureD3D12: set all root constants at once (#672)
1 parent 0c61209 commit 1c02a41

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Graphics/GraphicsEngineD3D12/src/PipelineResourceSignatureD3D12Impl.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -550,13 +550,11 @@ void PipelineResourceSignatureD3D12Impl::CommitRootConstants(const CommitCacheRe
550550
ID3D12GraphicsCommandList* const pd3d12CmdList = CommitAttribs.CmdCtx.GetCommandList();
551551
if (CommitAttribs.IsCompute)
552552
{
553-
for (Uint32 i = 0; i < NumConstants; ++i)
554-
pd3d12CmdList->SetComputeRoot32BitConstant(BaseRootIndex + RootInd, pConstants[i], i);
553+
pd3d12CmdList->SetComputeRoot32BitConstants(BaseRootIndex + RootInd, NumConstants, pConstants, 0);
555554
}
556555
else
557556
{
558-
for (Uint32 i = 0; i < NumConstants; ++i)
559-
pd3d12CmdList->SetGraphicsRoot32BitConstant(BaseRootIndex + RootInd, pConstants[i], i);
557+
pd3d12CmdList->SetGraphicsRoot32BitConstants(BaseRootIndex + RootInd, NumConstants, pConstants, 0);
560558
}
561559
}
562560
}

0 commit comments

Comments
 (0)