diff options
| author | 2018-07-24 12:19:39 -0400 | |
|---|---|---|
| committer | 2018-07-24 12:24:49 -0400 | |
| commit | 0162f8b3a74498f9ecf974594266239744d3187c (patch) | |
| tree | d3933d4d377204cba80166ac53e074fcc6e851e2 /src | |
| parent | gl_rasterizer: Use std::string_view instead of std::string when checking for ... (diff) | |
| download | yuzu-0162f8b3a74498f9ecf974594266239744d3187c.tar.gz yuzu-0162f8b3a74498f9ecf974594266239744d3187c.tar.xz yuzu-0162f8b3a74498f9ecf974594266239744d3187c.zip | |
gl_rasterizer: Replace magic number with GL_INVALID_INDEX in SetupConstBuffers()
This is just the named constant that OpenGL provides, so we can use that
instead of using a literal -1
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index f45fbbcd4..a1c47bae9 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -689,10 +689,12 @@ u32 RasterizerOpenGL::SetupConstBuffers(Maxwell::ShaderStage stage, GLuint progr | |||
| 689 | glBindBuffer(GL_UNIFORM_BUFFER, 0); | 689 | glBindBuffer(GL_UNIFORM_BUFFER, 0); |
| 690 | 690 | ||
| 691 | // Now configure the bindpoint of the buffer inside the shader | 691 | // Now configure the bindpoint of the buffer inside the shader |
| 692 | std::string buffer_name = used_buffer.GetName(); | 692 | const std::string buffer_name = used_buffer.GetName(); |
| 693 | GLuint index = glGetProgramResourceIndex(program, GL_UNIFORM_BLOCK, buffer_name.c_str()); | 693 | const GLuint index = |
| 694 | if (index != -1) | 694 | glGetProgramResourceIndex(program, GL_UNIFORM_BLOCK, buffer_name.c_str()); |
| 695 | if (index != GL_INVALID_INDEX) { | ||
| 695 | glUniformBlockBinding(program, index, buffer_draw_state.bindpoint); | 696 | glUniformBlockBinding(program, index, buffer_draw_state.bindpoint); |
| 697 | } | ||
| 696 | } | 698 | } |
| 697 | 699 | ||
| 698 | state.Apply(); | 700 | state.Apply(); |