summaryrefslogtreecommitdiffstats
path: root/Graphics/GLSLTools
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-07-04 23:21:24 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-07-04 23:21:24 +0000
commit19dcf476e8f9b079191bd43ee8da9e9cfe5e3e64 (patch)
tree4ebd90768fbcd8c6f5dda8f48e8558f59bf4a262 /Graphics/GLSLTools
parentFixed few issues with 3D texture views in GL and VK (diff)
downloadDiligentCore-19dcf476e8f9b079191bd43ee8da9e9cfe5e3e64.tar.gz
DiligentCore-19dcf476e8f9b079191bd43ee8da9e9cfe5e3e64.zip
Corrected depth-related GLSL definitions for Vulkan case
Diffstat (limited to 'Graphics/GLSLTools')
-rw-r--r--Graphics/GLSLTools/include/GLSLSourceBuilder.h2
-rw-r--r--Graphics/GLSLTools/src/GLSLSourceBuilder.cpp7
2 files changed, 7 insertions, 2 deletions
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;