summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-08-04 08:57:08 +0200
committerLioncash <mathew1800@gmail.com>2018-08-04 08:57:11 +0200
commit3b678b9e8e46d098571b22f1c25f7ff36caf3c2d (patch)
treeea918556c1d0a6a466e94c0b38d3adf317a9611d /src/video_core
parentgl_shader_manager: Amend sign differences in an assertion comparison in SetShaderUniformBlockBinding() (diff)
downloadyuzu-3b678b9e8e46d098571b22f1c25f7ff36caf3c2d.tar
yuzu-3b678b9e8e46d098571b22f1c25f7ff36caf3c2d.tar.gz
yuzu-3b678b9e8e46d098571b22f1c25f7ff36caf3c2d.tar.bz2
yuzu-3b678b9e8e46d098571b22f1c25f7ff36caf3c2d.tar.lz
yuzu-3b678b9e8e46d098571b22f1c25f7ff36caf3c2d.tar.xz
yuzu-3b678b9e8e46d098571b22f1c25f7ff36caf3c2d.tar.zst
yuzu-3b678b9e8e46d098571b22f1c25f7ff36caf3c2d.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_manager.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_manager.cpp b/src/video_core/renderer_opengl/gl_shader_manager.cpp
index 1d88f8cec..415d42fda 100644
--- a/src/video_core/renderer_opengl/gl_shader_manager.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_manager.cpp
@@ -13,14 +13,16 @@ namespace Impl {
static void SetShaderUniformBlockBinding(GLuint shader, const char* name,
Maxwell3D::Regs::ShaderStage binding,
size_t expected_size) {
- GLuint ub_index = glGetUniformBlockIndex(shader, name);
- if (ub_index != GL_INVALID_INDEX) {
- GLint ub_size = 0;
- glGetActiveUniformBlockiv(shader, ub_index, GL_UNIFORM_BLOCK_DATA_SIZE, &ub_size);
- ASSERT_MSG(static_cast<size_t>(ub_size) == expected_size,
- "Uniform block size did not match! Got {}, expected {}", ub_size, expected_size);
- glUniformBlockBinding(shader, ub_index, static_cast<GLuint>(binding));
+ const GLuint ub_index = glGetUniformBlockIndex(shader, name);
+ if (ub_index == GL_INVALID_INDEX) {
+ return;
}
+
+ GLint ub_size = 0;
+ glGetActiveUniformBlockiv(shader, ub_index, GL_UNIFORM_BLOCK_DATA_SIZE, &ub_size);
+ ASSERT_MSG(static_cast<size_t>(ub_size) == expected_size,
+ "Uniform block size did not match! Got {}, expected {}", ub_size, expected_size);
+ glUniformBlockBinding(shader, ub_index, static_cast<GLuint>(binding));
}
void SetShaderUniformBlockBindings(GLuint shader) {