summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_manager.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_manager.cpp b/src/video_core/renderer_opengl/gl_shader_manager.cpp
index e81fcbbc4..415d42fda 100644
--- a/src/video_core/renderer_opengl/gl_shader_manager.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_manager.cpp
@@ -13,15 +13,16 @@ namespace Impl {
13static void SetShaderUniformBlockBinding(GLuint shader, const char* name, 13static void SetShaderUniformBlockBinding(GLuint shader, const char* name,
14 Maxwell3D::Regs::ShaderStage binding, 14 Maxwell3D::Regs::ShaderStage binding,
15 size_t expected_size) { 15 size_t expected_size) {
16 GLuint ub_index = glGetUniformBlockIndex(shader, name); 16 const GLuint ub_index = glGetUniformBlockIndex(shader, name);
17 if (ub_index != GL_INVALID_INDEX) { 17 if (ub_index == GL_INVALID_INDEX) {
18 GLint ub_size = 0; 18 return;
19 glGetActiveUniformBlockiv(shader, ub_index, GL_UNIFORM_BLOCK_DATA_SIZE, &ub_size);
20 ASSERT_MSG(ub_size == expected_size,
21 "Uniform block size did not match! Got {}, expected {}",
22 static_cast<int>(ub_size), expected_size);
23 glUniformBlockBinding(shader, ub_index, static_cast<GLuint>(binding));
24 } 19 }
20
21 GLint ub_size = 0;
22 glGetActiveUniformBlockiv(shader, ub_index, GL_UNIFORM_BLOCK_DATA_SIZE, &ub_size);
23 ASSERT_MSG(static_cast<size_t>(ub_size) == expected_size,
24 "Uniform block size did not match! Got {}, expected {}", ub_size, expected_size);
25 glUniformBlockBinding(shader, ub_index, static_cast<GLuint>(binding));
25} 26}
26 27
27void SetShaderUniformBlockBindings(GLuint shader) { 28void SetShaderUniformBlockBindings(GLuint shader) {