summaryrefslogtreecommitdiffstats
path: root/examples/example-base/example-base.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/example-base/example-base.cpp')
-rw-r--r--examples/example-base/example-base.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/examples/example-base/example-base.cpp b/examples/example-base/example-base.cpp
index 9759e9f42..95864b0af 100644
--- a/examples/example-base/example-base.cpp
+++ b/examples/example-base/example-base.cpp
@@ -1,5 +1,7 @@
#include "example-base.h"
+#include "slang.h"
+
#include <chrono>
#ifdef _WIN32
@@ -23,6 +25,16 @@ Slang::Result WindowedAppBase::initializeBase(
#ifdef _DEBUG
deviceDesc.enableValidation = true;
#endif
+
+ slang::CompilerOptionEntry slangOptions[] = {
+ {slang::CompilerOptionName::EmitSpirvDirectly, {slang::CompilerOptionValueKind::Int, 1}},
+ {slang::CompilerOptionName::DebugInformation,
+ {slang::CompilerOptionValueKind::Int, SLANG_DEBUG_INFO_LEVEL_STANDARD}}};
+ deviceDesc.slang.compilerOptionEntries = slangOptions;
+ // When in test mode, don't include debug information to avoid altering hash values during
+ // testing Otherwise, include debug information for better debugging experience
+ deviceDesc.slang.compilerOptionEntryCount = isTestMode() ? 1 : 2;
+
gDevice = getRHI()->createDevice(deviceDesc);
if (!gDevice)
{