diff options
| author | 2018-08-04 14:29:59 -0400 | |
|---|---|---|
| committer | 2018-08-04 14:29:59 -0400 | |
| commit | 13d65937533a5b38b5e4d07cfa2101e2a5643d9f (patch) | |
| tree | 4d924f07ff49289875a70af4115b76025005f8db | |
| parent | Merge pull request #911 from lioncash/prototype (diff) | |
| parent | gl_shader_manager: Invert conditional in SetShaderUniformBlockBinding() (diff) | |
| download | yuzu-13d65937533a5b38b5e4d07cfa2101e2a5643d9f.tar.gz yuzu-13d65937533a5b38b5e4d07cfa2101e2a5643d9f.tar.xz yuzu-13d65937533a5b38b5e4d07cfa2101e2a5643d9f.zip | |
Merge pull request #919 from lioncash/sign
gl_shader_manager: Amend sign differences in an assertion comparison in SetShaderUniformBlockBinding()
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_manager.cpp | 17 |
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 { | |||
| 13 | static void SetShaderUniformBlockBinding(GLuint shader, const char* name, | 13 | static 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 | ||
| 27 | void SetShaderUniformBlockBindings(GLuint shader) { | 28 | void SetShaderUniformBlockBindings(GLuint shader) { |