summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJim Albamont <jim.albamont@kdab.com>2020-12-10 22:13:20 -0800
committerPaul Lemire <paul.lemire@kdab.com>2020-12-11 06:53:54 +0000
commite09188f773ab287dd8c4569a1996d89113bfd5d7 (patch)
tree3711bd75aabf2f063520190dba0e59b0b5614afe /src
parent612c7b5030e25e5750d5c02937d7e3211da0ef12 (diff)
Add missing sampler types and sizes to gl4 helpers
In particular the CubeMapArray and CubeMapArrayShadow were missing from the call to get uniform size causing a crash when these sampler types were used. While fixing this, I double-checked the samplers types in uniformByteSize uniformTypeFromGLType buildUniformBuffer and made sure they were consistent Change-Id: Ief91952fd7727945ba1c4156fe053587a4060684 Pick-to: 5.15 6.0 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4.cpp b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4.cpp
index cfefa9917..94510ff41 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4.cpp
+++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4.cpp
@@ -633,6 +633,7 @@ UniformType GraphicsHelperGL4::uniformTypeFromGLType(GLenum type)
case GL_SAMPLER_1D:
case GL_SAMPLER_1D_ARRAY:
case GL_SAMPLER_1D_SHADOW:
+ case GL_SAMPLER_1D_ARRAY_SHADOW:
case GL_SAMPLER_2D:
case GL_SAMPLER_2D_RECT:
case GL_SAMPLER_2D_SHADOW:
@@ -651,6 +652,7 @@ UniformType GraphicsHelperGL4::uniformTypeFromGLType(GLenum type)
case GL_INT_SAMPLER_2D:
case GL_INT_SAMPLER_3D:
case GL_INT_SAMPLER_BUFFER:
+ case GL_INT_SAMPLER_2D_RECT:
case GL_INT_SAMPLER_CUBE:
case GL_INT_SAMPLER_CUBE_MAP_ARRAY:
case GL_INT_SAMPLER_1D_ARRAY:
@@ -661,6 +663,7 @@ UniformType GraphicsHelperGL4::uniformTypeFromGLType(GLenum type)
case GL_UNSIGNED_INT_SAMPLER_2D:
case GL_UNSIGNED_INT_SAMPLER_3D:
case GL_UNSIGNED_INT_SAMPLER_BUFFER:
+ case GL_UNSIGNED_INT_SAMPLER_2D_RECT:
case GL_UNSIGNED_INT_SAMPLER_1D_ARRAY:
case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
@@ -1077,17 +1080,21 @@ void GraphicsHelperGL4::buildUniformBuffer(const QVariant &v, const ShaderUnifor
case GL_INT_SAMPLER_2D:
case GL_INT_SAMPLER_3D:
case GL_INT_SAMPLER_CUBE:
+ case GL_INT_SAMPLER_CUBE_MAP_ARRAY:
case GL_INT_SAMPLER_BUFFER:
case GL_INT_SAMPLER_2D_RECT:
case GL_UNSIGNED_INT_SAMPLER_1D:
case GL_UNSIGNED_INT_SAMPLER_2D:
case GL_UNSIGNED_INT_SAMPLER_3D:
case GL_UNSIGNED_INT_SAMPLER_CUBE:
+ case GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY:
case GL_UNSIGNED_INT_SAMPLER_BUFFER:
case GL_UNSIGNED_INT_SAMPLER_2D_RECT:
case GL_SAMPLER_1D_SHADOW:
case GL_SAMPLER_2D_SHADOW:
case GL_SAMPLER_CUBE_SHADOW:
+ case GL_SAMPLER_CUBE_MAP_ARRAY:
+ case GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW:
case GL_SAMPLER_1D_ARRAY:
case GL_SAMPLER_2D_ARRAY:
case GL_INT_SAMPLER_1D_ARRAY:
@@ -1250,6 +1257,10 @@ uint GraphicsHelperGL4::uniformByteSize(const ShaderUniform &description)
case GL_SAMPLER_1D_SHADOW:
case GL_SAMPLER_2D_SHADOW:
case GL_SAMPLER_CUBE_SHADOW:
+ case GL_SAMPLER_CUBE_MAP_ARRAY:
+ case GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW:
+ case GL_INT_SAMPLER_CUBE_MAP_ARRAY:
+ case GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY:
case GL_SAMPLER_1D_ARRAY:
case GL_SAMPLER_2D_ARRAY:
case GL_INT_SAMPLER_1D_ARRAY: