summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineVulkan
diff options
context:
space:
mode:
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
-rw-r--r--Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp
index 11385ae6..74293d1b 100644
--- a/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp
@@ -61,15 +61,19 @@ ShaderVkImpl::ShaderVkImpl(IReferenceCounters* pRefCounters,
DEV_CHECK_ERR(CreationAttribs.ByteCode == nullptr, "'ByteCode' must be null when shader is created from source code or a file");
DEV_CHECK_ERR(CreationAttribs.ByteCodeSize == 0, "'ByteCodeSize' must be 0 when shader is created from source code or a file");
+ static constexpr char* VulkanDefine =
+ "#ifndef VULKAN\n"
+ "# define VULKAN 1\n"
+ "#endif\n";
if (CreationAttribs.SourceLanguage == SHADER_SOURCE_LANGUAGE_HLSL)
{
- m_SPIRV = HLSLtoSPIRV(CreationAttribs, CreationAttribs.ppCompilerOutput);
+ m_SPIRV = HLSLtoSPIRV(CreationAttribs, VulkanDefine, CreationAttribs.ppCompilerOutput);
}
else
{
auto GLSLSource = BuildGLSLSourceString(CreationAttribs, pRenderDeviceVk->GetDeviceCaps(),
TargetGLSLCompiler::glslang,
- "#define TARGET_API_VULKAN 1\n");
+ VulkanDefine);
m_SPIRV = GLSLtoSPIRV(m_Desc.ShaderType, GLSLSource.c_str(),
static_cast<int>(GLSLSource.length()),