From 3f1632a1450a5879f337b4bd178e48880cd583f8 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 31 Mar 2021 11:35:17 -0700 Subject: `gfx` explicit transient resource management. (#1774) --- tools/platform/gui.cpp | 4 ++-- tools/platform/gui.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'tools/platform') diff --git a/tools/platform/gui.cpp b/tools/platform/gui.cpp index e33a504bb..f78a52ce4 100644 --- a/tools/platform/gui.cpp +++ b/tools/platform/gui.cpp @@ -188,7 +188,7 @@ void GUI::beginFrame() ImGui::NewFrame(); } -void GUI::endFrame(IFramebuffer* framebuffer) +void GUI::endFrame(ITransientResourceHeap* transientHeap, IFramebuffer* framebuffer) { ImGui::Render(); @@ -217,7 +217,7 @@ void GUI::endFrame(IFramebuffer* framebuffer) auto indexBuffer = device->createBufferResource( IResource::Usage::IndexBuffer, indexBufferDesc); - auto cmdBuf = queue->createCommandBuffer(); + auto cmdBuf = transientHeap->createCommandBuffer(); auto encoder = cmdBuf->encodeResourceCommands(); { for(int ii = 0; ii < commandListCount; ++ii) diff --git a/tools/platform/gui.h b/tools/platform/gui.h index ef5310cd4..e3975f3ff 100644 --- a/tools/platform/gui.h +++ b/tools/platform/gui.h @@ -19,7 +19,7 @@ struct GUI : Slang::RefObject ~GUI(); void beginFrame(); - void endFrame(gfx::IFramebuffer* framebuffer); + void endFrame(gfx::ITransientResourceHeap* transientHeap, gfx::IFramebuffer* framebuffer); private: Slang::ComPtr device; -- cgit v1.2.3