summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/gfx/vulkan/vk-shader-program.cpp7
-rw-r--r--tools/render-test/options.cpp6
-rw-r--r--tools/render-test/options.h4
3 files changed, 13 insertions, 4 deletions
diff --git a/tools/gfx/vulkan/vk-shader-program.cpp b/tools/gfx/vulkan/vk-shader-program.cpp
index ee307ed04..caa219c99 100644
--- a/tools/gfx/vulkan/vk-shader-program.cpp
+++ b/tools/gfx/vulkan/vk-shader-program.cpp
@@ -74,9 +74,10 @@ Result ShaderProgramImpl::createShaderModule(
// to control the entry point naming behavior in SPIRV-direct path
// so we can remove the ad-hoc logic here.
auto realEntryPointName = entryPointInfo->getNameOverride();
- const char* spirvBinaryEntryPointName = "main";
- if (m_device->m_desc.slang.targetFlags & SLANG_TARGET_FLAG_GENERATE_SPIRV_DIRECTLY)
- spirvBinaryEntryPointName = realEntryPointName;
+ const char* spirvBinaryEntryPointName =
+ m_device->m_desc.slang.targetFlags & SLANG_TARGET_FLAG_GENERATE_SPIRV_DIRECTLY
+ ? realEntryPointName
+ : "main";
m_stageCreateInfos.add(compileEntryPoint(
spirvBinaryEntryPointName,
kernelCode,
diff --git a/tools/render-test/options.cpp b/tools/render-test/options.cpp
index 3b2c07ce6..2f304b7c0 100644
--- a/tools/render-test/options.cpp
+++ b/tools/render-test/options.cpp
@@ -143,7 +143,11 @@ static gfx::DeviceType _toRenderType(Slang::RenderApiType apiType)
}
else if (argValue == "-emit-spirv-directly")
{
- outOptions.generateSPIRVDirectly = true;
+ outOptions.generateSPIRVDirectly= true;
+ }
+ else if (argValue == "-emit-spirv-via-glsl")
+ {
+ outOptions.generateSPIRVDirectly= false;
}
else if (argValue == "-only-startup")
{
diff --git a/tools/render-test/options.h b/tools/render-test/options.h
index 22b14c862..c2466f671 100644
--- a/tools/render-test/options.h
+++ b/tools/render-test/options.h
@@ -71,7 +71,11 @@ struct Options
Slang::DownstreamArgs downstreamArgs; ///< Args to downstream tools. Here it's just slang
+#if defined(SLANG_CONFIG_DEFAULT_SPIRV_DIRECT)
+ bool generateSPIRVDirectly = true;
+#else
bool generateSPIRVDirectly = false;
+#endif
Options() { downstreamArgs.addName("slang"); }