From 19dcf476e8f9b079191bd43ee8da9e9cfe5e3e64 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Wed, 4 Jul 2018 16:21:24 -0700 Subject: Corrected depth-related GLSL definitions for Vulkan case --- Graphics/GLSLTools/include/GLSLSourceBuilder.h | 2 +- Graphics/GLSLTools/src/GLSLSourceBuilder.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'Graphics/GLSLTools') diff --git a/Graphics/GLSLTools/include/GLSLSourceBuilder.h b/Graphics/GLSLTools/include/GLSLSourceBuilder.h index 572ea180..b77b1055 100644 --- a/Graphics/GLSLTools/include/GLSLSourceBuilder.h +++ b/Graphics/GLSLTools/include/GLSLSourceBuilder.h @@ -35,6 +35,6 @@ enum TargetGLSLCompiler driver }; -String BuildGLSLSourceString(const ShaderCreationAttribs &CreationAttribs, TargetGLSLCompiler TargetCompiler); +String BuildGLSLSourceString(const ShaderCreationAttribs& CreationAttribs, TargetGLSLCompiler TargetCompiler, const char* ExtraDefinitions = nullptr); } \ No newline at end of file diff --git a/Graphics/GLSLTools/src/GLSLSourceBuilder.cpp b/Graphics/GLSLTools/src/GLSLSourceBuilder.cpp index e37206b1..d5a8ee09 100644 --- a/Graphics/GLSLTools/src/GLSLSourceBuilder.cpp +++ b/Graphics/GLSLTools/src/GLSLSourceBuilder.cpp @@ -32,7 +32,7 @@ namespace Diligent { -String BuildGLSLSourceString(const ShaderCreationAttribs &CreationAttribs, TargetGLSLCompiler TargetCompiler) +String BuildGLSLSourceString(const ShaderCreationAttribs& CreationAttribs, TargetGLSLCompiler TargetCompiler, const char* ExtraDefinitions) { String GLSLSource; @@ -189,6 +189,11 @@ String BuildGLSLSourceString(const ShaderCreationAttribs &CreationAttribs, Targe } GLSLSource += ShaderTypeDefine; + if(ExtraDefinitions != nullptr) + { + GLSLSource.append(ExtraDefinitions); + } + if (CreationAttribs.Macros != nullptr) { auto *pMacro = CreationAttribs.Macros; -- cgit v1.2.3