summaryrefslogtreecommitdiffstats
path: root/examples/heterogeneous-hello-world/main.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2021-02-24 15:43:43 -0800
committerGitHub <noreply@github.com>2021-02-24 15:43:43 -0800
commit9b7a007c31072bc9aebd1134aa4f1bfd28a4c541 (patch)
treeb71a48eb30b3b09ab4e77e40dc1c68ecd854ef82 /examples/heterogeneous-hello-world/main.cpp
parentd66b30729029bdb43892e05c9c80fd56ac95a24f (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 'examples/heterogeneous-hello-world/main.cpp')
-rw-r--r--examples/heterogeneous-hello-world/main.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/examples/heterogeneous-hello-world/main.cpp b/examples/heterogeneous-hello-world/main.cpp
index ff44ecc45..010434bfa 100644
--- a/examples/heterogeneous-hello-world/main.cpp
+++ b/examples/heterogeneous-hello-world/main.cpp
@@ -124,9 +124,8 @@ gfx::IRenderer* createRenderer(
//
IRenderer::Desc rendererDesc = {};
rendererDesc.rendererType = gfx::RendererType::DirectX11;
- rendererDesc.width = windowWidth;
- rendererDesc.height = windowHeight;
- Result res = gfxCreateRenderer(&rendererDesc, getPlatformWindowHandle(window), gRenderer.writeRef());
+ Result res = gfxCreateRenderer(&rendererDesc, gRenderer.writeRef());
+
if (SLANG_FAILED(res)) return nullptr;
return gRenderer;
}
@@ -196,7 +195,7 @@ gfx::IDescriptorSet* buildDescriptorSet(
// Once we have the descriptor set layout, we can allocate
// and fill in a descriptor set to hold our parameters.
//
- gDescriptorSet = renderer->createDescriptorSet(descriptorSetLayout);
+ gDescriptorSet = renderer->createDescriptorSet(descriptorSetLayout, gfx::IDescriptorSet::Flag::Transient);
if(!gDescriptorSet) return nullptr;
// Once we have the bufferResource created, we can fill in