diff options
| author | Yong He <yonghe@outlook.com> | 2021-02-24 15:43:43 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-24 15:43:43 -0800 |
| commit | 9b7a007c31072bc9aebd1134aa4f1bfd28a4c541 (patch) | |
| tree | b71a48eb30b3b09ab4e77e40dc1c68ecd854ef82 /tools/graphics-app-framework | |
| parent | d66b30729029bdb43892e05c9c80fd56ac95a24f (diff) | |
Explicit swapchain interface in `gfx`. (#1726)
* Explicit swapchain interface in `gfx`.
* Correctly return nullptr when `IRenderer` creation failed.
* Fix crashes on CUDA tests.
* Cleanups.
Diffstat (limited to 'tools/graphics-app-framework')
| -rw-r--r-- | tools/graphics-app-framework/gui.cpp | 6 | ||||
| -rw-r--r-- | tools/graphics-app-framework/gui.h | 2 |
2 files changed, 4 insertions, 4 deletions
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); diff --git a/tools/graphics-app-framework/gui.h b/tools/graphics-app-framework/gui.h index 3ef2b0ba5..22b4bf2f5 100644 --- a/tools/graphics-app-framework/gui.h +++ b/tools/graphics-app-framework/gui.h @@ -12,7 +12,7 @@ namespace gfx { struct GUI : Slang::RefObject { - GUI(Window* window, IRenderer* renderer); + GUI(Window* window, IRenderer* renderer, IFramebufferLayout* framebufferLayout); ~GUI(); void beginFrame(); |
