@@ -957,18 +957,17 @@ class DXDevice : public offloadtest::Device {
957
957
}
958
958
959
959
llvm::Error createComputeCommands (Pipeline &P, InvocationState &IS) {
960
- IS.CmdList ->SetPipelineState (IS.PSO .Get ());
961
- IS.CmdList ->SetComputeRootSignature (IS.RootSig .Get ());
962
-
963
- const uint32_t Inc = Device->GetDescriptorHandleIncrementSize (
964
- D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV);
965
960
CD3DX12_GPU_DESCRIPTOR_HANDLE Handle;
966
-
967
961
if (IS.DescHeap ) {
968
962
ID3D12DescriptorHeap *const Heaps[] = {IS.DescHeap .Get ()};
969
963
IS.CmdList ->SetDescriptorHeaps (1 , Heaps);
970
964
Handle = IS.DescHeap ->GetGPUDescriptorHandleForHeapStart ();
971
965
}
966
+ IS.CmdList ->SetComputeRootSignature (IS.RootSig .Get ());
967
+ IS.CmdList ->SetPipelineState (IS.PSO .Get ());
968
+
969
+ const uint32_t Inc = Device->GetDescriptorHandleIncrementSize (
970
+ D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV);
972
971
973
972
if (P.Settings .DX .RootParams .size () > 0 ) {
974
973
uint32_t ConstantOffset = 0u ;
@@ -1315,8 +1314,14 @@ class DXDevice : public offloadtest::Device {
1315
1314
IS.RTVHeap ->GetCPUDescriptorHandleForHeapStart ();
1316
1315
Device->CreateRenderTargetView (IS.RT .Get (), nullptr , RTVHandle);
1317
1316
1318
- IS.CmdList ->SetPipelineState (IS.PSO .Get ());
1317
+ if (IS.DescHeap ) {
1318
+ ID3D12DescriptorHeap *const Heaps[] = {IS.DescHeap .Get ()};
1319
+ IS.CmdList ->SetDescriptorHeaps (1 , Heaps);
1320
+ IS.CmdList ->SetGraphicsRootDescriptorTable (
1321
+ 0 , IS.DescHeap ->GetGPUDescriptorHandleForHeapStart ());
1322
+ }
1319
1323
IS.CmdList ->SetGraphicsRootSignature (IS.RootSig .Get ());
1324
+ IS.CmdList ->SetPipelineState (IS.PSO .Get ());
1320
1325
1321
1326
IS.CmdList ->OMSetRenderTargets (1 , &RTVHandle, false , nullptr );
1322
1327
@@ -1334,13 +1339,6 @@ class DXDevice : public offloadtest::Device {
1334
1339
static_cast <LONG>(VP.Height )};
1335
1340
IS.CmdList ->RSSetScissorRects (1 , &Scissor);
1336
1341
1337
- if (IS.DescHeap ) {
1338
- ID3D12DescriptorHeap *const Heaps[] = {IS.DescHeap .Get ()};
1339
- IS.CmdList ->SetDescriptorHeaps (1 , Heaps);
1340
- IS.CmdList ->SetGraphicsRootDescriptorTable (
1341
- 0 , IS.DescHeap ->GetGPUDescriptorHandleForHeapStart ());
1342
- }
1343
-
1344
1342
IS.CmdList ->DrawInstanced (P.Bindings .getVertexCount (), 1 , 0 , 0 );
1345
1343
1346
1344
// Transition the render target to copy source and copy to the readback
0 commit comments