summaryrefslogtreecommitdiffstats
path: root/examples/example-base
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2021-06-30 14:59:18 -0700
committerGitHub <noreply@github.com>2021-06-30 14:59:18 -0700
commita03d21a5f54cba913c3f52e2822a433de8f39fdd (patch)
tree84d24d4355cc4b3e941da9eab57147cd9d297ee4 /examples/example-base
parent5395ef82535c283109b1ea6b89b737c5a39bf147 (diff)
[gfx] Add inline ray tracing support. (#1899)
Diffstat (limited to 'examples/example-base')
-rw-r--r--examples/example-base/example-base.cpp8
-rw-r--r--examples/example-base/example-base.h6
2 files changed, 11 insertions, 3 deletions
diff --git a/examples/example-base/example-base.cpp b/examples/example-base/example-base.cpp
index 04f938697..c45e3cc27 100644
--- a/examples/example-base/example-base.cpp
+++ b/examples/example-base/example-base.cpp
@@ -9,7 +9,11 @@
using namespace Slang;
using namespace gfx;
-Slang::Result WindowedAppBase::initializeBase(const char* title, int width, int height)
+Slang::Result WindowedAppBase::initializeBase(
+ const char* title,
+ int width,
+ int height,
+ DeviceType deviceType)
{
// Create a window for our application to render into.
//
@@ -30,7 +34,7 @@ Slang::Result WindowedAppBase::initializeBase(const char* title, int width, int
gfxEnableDebugLayer();
#endif
IDevice::Desc deviceDesc = {};
- // deviceDesc.slang.targetFlags = SLANG_TARGET_FLAG_DUMP_IR;
+ deviceDesc.deviceType = deviceType;
gfx::Result res = gfxCreateDevice(&deviceDesc, gDevice.writeRef());
if (SLANG_FAILED(res))
return res;
diff --git a/examples/example-base/example-base.h b/examples/example-base/example-base.h
index a1c46aa53..b898f7417 100644
--- a/examples/example-base/example-base.h
+++ b/examples/example-base/example-base.h
@@ -26,7 +26,11 @@ protected:
Slang::ComPtr<gfx::IRenderPassLayout> gRenderPass;
Slang::ComPtr<gfx::ICommandQueue> gQueue;
- Slang::Result initializeBase(const char* titile, int width, int height);
+ Slang::Result initializeBase(
+ const char* titile,
+ int width,
+ int height,
+ gfx::DeviceType deviceType = gfx::DeviceType::Default);
void createSwapchainFramebuffers();
void mainLoop();