diff options
author | Jim Albamont <jim.albamont@kdab.com> | 2020-12-10 22:13:20 -0800 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2021-08-04 18:36:42 +0200 |
commit | c424e4bb39d66e720a15e3eec833ba827d00ed6b (patch) | |
tree | 2a7a166bbbc4c154a2a991ea416c4d2f02be5f83 | |
parent | 65ebf7aa0e173fe9c32d31abe64e1fe7a8b85fb3 (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
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
(cherry picked from commit e09188f773ab287dd8c4569a1996d89113bfd5d7)
-rw-r--r-- | src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4.cpp | 11 |
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 a88736570..4e165b942 100644 --- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4.cpp +++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4.cpp @@ -634,6 +634,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: @@ -652,6 +653,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: @@ -662,6 +664,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: @@ -1078,17 +1081,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: @@ -1251,6 +1258,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: |