summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-05-18 04:36:46 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-05-18 04:36:46 +0000
commitc0087704ea69eec2d52d4db891309b362a2c2812 (patch)
tree98f1d5efaaec4a8d57524e7d55714402a862d3c3 /Graphics/GraphicsEngine
parentAdded texel uniform/storage buffer detection (diff)
downloadDiligentCore-c0087704ea69eec2d52d4db891309b362a2c2812.tar.gz
DiligentCore-c0087704ea69eec2d52d4db891309b362a2c2812.zip
Reworked SPIRVShaderResources: reduced sizeof(SPIRVShaderResourceAttribs) to 32; packing resource names into the string pool
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/include/ShaderBase.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/Graphics/GraphicsEngine/include/ShaderBase.h b/Graphics/GraphicsEngine/include/ShaderBase.h
index fb5f132b..2de7a3d5 100644
--- a/Graphics/GraphicsEngine/include/ShaderBase.h
+++ b/Graphics/GraphicsEngine/include/ShaderBase.h
@@ -92,6 +92,26 @@ inline SHADER_VARIABLE_TYPE GetShaderVariableType(const Char* Name, SHADER_VARIA
);
}
+inline SHADER_VARIABLE_TYPE GetShaderVariableType(const Char* Name, const ShaderDesc& ShdrDesc)
+{
+ return GetShaderVariableType(Name, ShdrDesc.DefaultVariableType, ShdrDesc.VariableDesc, ShdrDesc.NumVariables);
+}
+
+inline SHADER_VARIABLE_TYPE GetShaderVariableType(const String& Name, SHADER_VARIABLE_TYPE DefaultVariableType, const ShaderVariableDesc *VariableDesc, Uint32 NumVars)
+{
+ return GetShaderVariableType(DefaultVariableType, VariableDesc, NumVars,
+ [&](const char *VarName)
+ {
+ return Name.compare(VarName) == 0;
+ }
+ );
+}
+
+inline SHADER_VARIABLE_TYPE GetShaderVariableType(const String& Name, const ShaderDesc& ShdrDesc)
+{
+ return GetShaderVariableType(Name, ShdrDesc.DefaultVariableType, ShdrDesc.VariableDesc, ShdrDesc.NumVariables);
+}
+
/// Base implementation of a shader variable