summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineOpenGL
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-03-07 07:08:56 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-03-07 07:08:56 +0000
commitab236520f301243eefbd17977ff7b57f6af2fac9 (patch)
tree925c4f2ed070e4c82337b5395f69b8c59440b83c /Graphics/GraphicsEngineOpenGL
parentFixed minor issue with ShaderResources::GetShaderResourceDesc() function in D... (diff)
downloadDiligentCore-ab236520f301243eefbd17977ff7b57f6af2fac9.tar.gz
DiligentCore-ab236520f301243eefbd17977ff7b57f6af2fac9.zip
Added GetShaderResourceTypeLiteralName accessory function plus fixed issue with GL resource type reflection.
Fixed https://github.com/DiligentGraphics/DiligentCore/issues/8
Diffstat (limited to 'Graphics/GraphicsEngineOpenGL')
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/GLProgramResources.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Graphics/GraphicsEngineOpenGL/src/GLProgramResources.cpp b/Graphics/GraphicsEngineOpenGL/src/GLProgramResources.cpp
index 21a2ac5d..ff21c609 100644
--- a/Graphics/GraphicsEngineOpenGL/src/GLProgramResources.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/GLProgramResources.cpp
@@ -415,13 +415,18 @@ namespace Diligent
// glGetProgramResourceLocation( program, GL_UNIFORM, name );
// The latter is only available in GL 4.4 and GLES 3.1
+ auto ResourceType = dataType == GL_SAMPLER_BUFFER ||
+ dataType == GL_INT_SAMPLER_BUFFER ||
+ dataType == GL_UNSIGNED_INT_SAMPLER_BUFFER ?
+ SHADER_RESOURCE_TYPE_BUFFER_SRV : SHADER_RESOURCE_TYPE_TEXTURE_SRV;
+
RemoveArrayBrackets(Name.data());
Samplers.emplace_back(
Owner,
NamesPool.emplace(Name.data()).first->c_str(),
SHADER_RESOURCE_VARIABLE_TYPE_STATIC,
- SHADER_RESOURCE_TYPE_TEXTURE_SRV,
+ ResourceType,
Uint16{0xFFFF}, // Variable index is assigned by AllocateResources
static_cast<Uint32>(size),
nullptr, // pResources