summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-08-04 20:29:59 +0200
committerGitHub <noreply@github.com>2018-08-04 20:29:59 +0200
commit13d65937533a5b38b5e4d07cfa2101e2a5643d9f (patch)
tree4d924f07ff49289875a70af4115b76025005f8db
parentMerge pull request #911 from lioncash/prototype (diff)
parentgl_shader_manager: Invert conditional in SetShaderUniformBlockBinding() (diff)
downloadyuzu-13d65937533a5b38b5e4d07cfa2101e2a5643d9f.tar
yuzu-13d65937533a5b38b5e4d07cfa2101e2a5643d9f.tar.gz
yuzu-13d65937533a5b38b5e4d07cfa2101e2a5643d9f.tar.bz2
yuzu-13d65937533a5b38b5e4d07cfa2101e2a5643d9f.tar.lz
yuzu-13d65937533a5b38b5e4d07cfa2101e2a5643d9f.tar.xz
yuzu-13d65937533a5b38b5e4d07cfa2101e2a5643d9f.tar.zst
yuzu-13d65937533a5b38b5e4d07cfa2101e2a5643d9f.zip
-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 {
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(ub_size == expected_size,
- "Uniform block size did not match! Got {}, expected {}",
- static_cast<int>(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) {