summaryrefslogtreecommitdiffstats
path: root/examples/gpu-printing/main.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2021-03-31 11:35:17 -0700
committerGitHub <noreply@github.com>2021-03-31 11:35:17 -0700
commit3f1632a1450a5879f337b4bd178e48880cd583f8 (patch)
treedb4adc2ac0f6113dfd4a97a0e2f7a0c4312ef48b /examples/gpu-printing/main.cpp
parent5fde038b1a6b3c8b335cd5b380c3ee8d15403052 (diff)
`gfx` explicit transient resource management. (#1774)
Diffstat (limited to 'examples/gpu-printing/main.cpp')
-rw-r--r--examples/gpu-printing/main.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/gpu-printing/main.cpp b/examples/gpu-printing/main.cpp
index 0315d4827..a0acb8159 100644
--- a/examples/gpu-printing/main.cpp
+++ b/examples/gpu-printing/main.cpp
@@ -113,9 +113,13 @@ Result execute()
printBufferViewDesc.type = IResourceView::Type::UnorderedAccess;
auto printBufferView = gDevice->createBufferView(printBuffer, printBufferViewDesc);
+ ITransientResourceHeap::Desc transientResourceHeapDesc = {};
+ transientResourceHeapDesc.constantBufferSize = 256;
+ auto transientHeap = gDevice->createTransientResourceHeap(transientResourceHeapDesc);
+
ICommandQueue::Desc queueDesc = {ICommandQueue::QueueType::Graphics};
auto queue = gDevice->createCommandQueue(queueDesc);
- auto commandBuffer = queue->createCommandBuffer();
+ auto commandBuffer = transientHeap->createCommandBuffer();
auto encoder = commandBuffer->encodeComputeCommands();
auto rootShaderObject = gDevice->createRootShaderObject(gProgram);
encoder->setPipelineState(gPipelineState);