Skip to content

Commit 6a9d6f2

Browse files
committed
Combine command lists
1 parent 965ec9b commit 6a9d6f2

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

lib/API/DX/Device.cpp

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -504,14 +504,8 @@ class DXDevice : public hlsltest::Device {
504504
return waitForSignal(IS);
505505
}
506506

507-
llvm::Error createComputeCommands(Pipeline &P, InvocationState &IS) {
508-
if (auto Err =
509-
HR::toError(IS.Allocator->Reset(), "Failed to reset allocator."))
510-
return Err;
511-
if (auto Err = HR::toError(IS.CmdList->Reset(IS.Allocator, IS.PSO),
512-
"Failed to reset command list."))
513-
return Err;
514-
507+
void createComputeCommands(Pipeline &P, InvocationState &IS) {
508+
IS.CmdList->SetPipelineState(IS.PSO);
515509
IS.CmdList->SetComputeRootSignature(IS.RootSig);
516510

517511
ID3D12DescriptorHeap *const Heaps[] = {IS.DescHeap};
@@ -537,8 +531,6 @@ class DXDevice : public hlsltest::Device {
537531
IS.CmdList->CopyResource(Out.second.Readback, Out.second.Buffer);
538532
addReadbackEndBarrier(IS, Out.second.Buffer);
539533
}
540-
541-
return llvm::Error::success();
542534
}
543535

544536
llvm::Error readBack(Pipeline &P, InvocationState &IS) {
@@ -587,11 +579,7 @@ class DXDevice : public hlsltest::Device {
587579
if (auto Err = createEvent(State))
588580
return Err;
589581
llvm::outs() << "Event prepared.\n";
590-
if (auto Err = executeCommandList(State))
591-
return Err;
592-
llvm::outs() << "Preparation commands executed.\n";
593-
if (auto Err = createComputeCommands(P, State))
594-
return Err;
582+
createComputeCommands(P, State);
595583
llvm::outs() << "Compute command list created.\n";
596584
if (auto Err = executeCommandList(State))
597585
return Err;

0 commit comments

Comments
 (0)