diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2019-03-07 07:08:56 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2019-03-07 07:08:56 +0000 |
| commit | ab236520f301243eefbd17977ff7b57f6af2fac9 (patch) | |
| tree | 925c4f2ed070e4c82337b5395f69b8c59440b83c /Graphics/GraphicsEngineOpenGL | |
| parent | Fixed minor issue with ShaderResources::GetShaderResourceDesc() function in D... (diff) | |
| download | DiligentCore-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.cpp | 7 |
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 |
