From 9b7a007c31072bc9aebd1134aa4f1bfd28a4c541 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 24 Feb 2021 15:43:43 -0800 Subject: Explicit swapchain interface in `gfx`. (#1726) * Explicit swapchain interface in `gfx`. * Correctly return nullptr when `IRenderer` creation failed. * Fix crashes on CUDA tests. * Cleanups. --- tools/graphics-app-framework/gui.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tools/graphics-app-framework/gui.cpp') diff --git a/tools/graphics-app-framework/gui.cpp b/tools/graphics-app-framework/gui.cpp index 3bc365701..0d416ec85 100644 --- a/tools/graphics-app-framework/gui.cpp +++ b/tools/graphics-app-framework/gui.cpp @@ -36,7 +36,7 @@ void setNativeWindowHook(Window* window, WNDPROC proc); #endif -GUI::GUI(Window* window, IRenderer* inRenderer) +GUI::GUI(Window* window, IRenderer* inRenderer, IFramebufferLayout* framebufferLayout) : renderer(inRenderer) { ImGui::CreateContext(); @@ -188,7 +188,7 @@ GUI::GUI(Window* window, IRenderer* inRenderer) targetBlendDesc.alpha.dstFactor = BlendFactor::Zero; GraphicsPipelineStateDesc pipelineDesc; - pipelineDesc.renderTargetCount = 1; + pipelineDesc.framebufferLayout = framebufferLayout; pipelineDesc.program = program; pipelineDesc.pipelineLayout = pipelineLayout; pipelineDesc.inputLayout = inputLayout; @@ -367,7 +367,7 @@ void GUI::endFrame() renderer->setScissorRect(rect); // TODO: This should be a dynamic/transient descriptor set... - auto descriptorSet = renderer->createDescriptorSet(descriptorSetLayout); + auto descriptorSet = renderer->createDescriptorSet(descriptorSetLayout, gfx::IDescriptorSet::Flag::Transient); descriptorSet->setConstantBuffer(0, 0, constantBuffer); descriptorSet->setResource(1, 0, (gfx::IResourceView*) command->TextureId); -- cgit v1.2.3