summaryrefslogtreecommitdiffstats
path: root/Graphics
diff options
context:
space:
mode:
authorEgor <egor.yusov@gmail.com>2019-10-13 02:48:28 +0000
committerEgor <egor.yusov@gmail.com>2019-10-13 02:48:28 +0000
commita301d715ccd830ab8b5f15c4432efea0d8d1db86 (patch)
tree3b8baa4b72201fd7535d0e8c73f71808806c5ac9 /Graphics
parentOpenGL buffer implementation: removed MapWriteDiscardBugWA (diff)
downloadDiligentCore-a301d715ccd830ab8b5f15c4432efea0d8d1db86.tar.gz
DiligentCore-a301d715ccd830ab8b5f15c4432efea0d8d1db86.zip
GL backend: fixed few GLES issues
Diffstat (limited to 'Graphics')
-rw-r--r--Graphics/GLSLTools/src/GLSLSourceBuilder.cpp17
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/GLProgramResources.cpp9
2 files changed, 22 insertions, 4 deletions
diff --git a/Graphics/GLSLTools/src/GLSLSourceBuilder.cpp b/Graphics/GLSLTools/src/GLSLSourceBuilder.cpp
index b41b49c1..9079039f 100644
--- a/Graphics/GLSLTools/src/GLSLSourceBuilder.cpp
+++ b/Graphics/GLSLTools/src/GLSLSourceBuilder.cpp
@@ -143,6 +143,15 @@ String BuildGLSLSourceString(const ShaderCreateInfo& CreationAttribs,
"precision highp usampler2DArray;\n"
);
+ if (IsES32OrAbove)
+ {
+ GLSLSource.append(
+ "precision highp samplerBuffer;\n"
+ "precision highp isamplerBuffer;\n"
+ "precision highp usamplerBuffer;\n"
+ );
+ }
+
if (deviceCaps.TexCaps.bCubemapArraysSupported)
{
GLSLSource.append(
@@ -180,6 +189,14 @@ String BuildGLSLSourceString(const ShaderCreateInfo& CreationAttribs,
"precision highp uimageCube;\n"
"precision highp uimage2DArray;\n"
);
+ if (IsES32OrAbove)
+ {
+ GLSLSource.append(
+ "precision highp imageBuffer;\n"
+ "precision highp iimageBuffer;\n"
+ "precision highp uimageBuffer;\n"
+ );
+ }
}
if (IsES30 && deviceCaps.bSeparableProgramSupported && ShaderType == SHADER_TYPE_VERTEX)
diff --git a/Graphics/GraphicsEngineOpenGL/src/GLProgramResources.cpp b/Graphics/GraphicsEngineOpenGL/src/GLProgramResources.cpp
index 52862588..dc8d5aec 100644
--- a/Graphics/GraphicsEngineOpenGL/src/GLProgramResources.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/GLProgramResources.cpp
@@ -415,13 +415,13 @@ void GLProgramResources::LoadUniforms(SHADER_TYPE Shad
{
// glUniform1i for image uniforms is not supported in at least GLES3.2.
// glProgramUniform1i is not available in GLES3.0
- glUniform1i(UniformLocation + arr_ind, ImageBinding++);
+ glUniform1i(UniformLocation + arr_ind, ImageBinding);
if (glGetError() != GL_NO_ERROR)
{
if (size > 1)
{
LOG_WARNING_MESSAGE("Failed to set binding for image uniform '", Name.data(), "'[", arr_ind,
- "]. Expected binding: ", ImageBinding,
+ "]. Expected binding: ", ImageBinding, "."
" Make sure that this binding is explicitly assigned in shader source code."
" Note that if the source code is converted from HLSL and if images are only used"
" by a single shader stage, then bindings automatically assigned by HLSL->GLSL"
@@ -430,13 +430,14 @@ void GLProgramResources::LoadUniforms(SHADER_TYPE Shad
else
{
LOG_WARNING_MESSAGE("Failed to set binding for image uniform '", Name.data(), "'."
- " Expected binding: ", ImageBinding,
+ " Expected binding: ", ImageBinding, "."
" Make sure that this binding is explicitly assigned in shader source code."
" Note that if the source code is converted from HLSL and if images are only used"
" by a single shader stage, then bindings automatically assigned by HLSL->GLSL"
" converter will work fine.");
}
}
+ ++ImageBinding;
}
break;
@@ -573,7 +574,7 @@ void GLProgramResources::LoadUniforms(SHADER_TYPE Shad
{
LOG_WARNING_MESSAGE("glShaderStorageBlockBinding is not available on this device and "
"the engine is unable to automatically assign shader storage block bindindg for '",
- Name.data(), "' variable. Expected binding: ", StorageBufferBinding,
+ Name.data(), "' variable. Expected binding: ", StorageBufferBinding, "."
" Make sure that this binding is explicitly assigned in shader source code."
" Note that if the source code is converted from HLSL and if storage blocks are only used"
" by a single shader stage, then bindings automatically assigned by HLSL->GLSL"