forked from ShuriZma/suyu
1
0
Fork 0

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
This commit is contained in:
Lioncash 2018-07-24 12:19:39 -04:00
parent 16139ed53b
commit 0162f8b3a7
1 changed files with 5 additions and 3 deletions

View File

@ -689,11 +689,13 @@ u32 RasterizerOpenGL::SetupConstBuffers(Maxwell::ShaderStage stage, GLuint progr
glBindBuffer(GL_UNIFORM_BUFFER, 0);
// Now configure the bindpoint of the buffer inside the shader
std::string buffer_name = used_buffer.GetName();
GLuint index = glGetProgramResourceIndex(program, GL_UNIFORM_BLOCK, buffer_name.c_str());
if (index != -1)
const std::string buffer_name = used_buffer.GetName();
const GLuint index =
glGetProgramResourceIndex(program, GL_UNIFORM_BLOCK, buffer_name.c_str());
if (index != GL_INVALID_INDEX) {
glUniformBlockBinding(program, index, buffer_draw_state.bindpoint);
}
}
state.Apply();