mirror of
https://git.h3cjp.net/H3cJP/yuzu.git
synced 2024-11-11 20:42:50 +00:00
Merge pull request #919 from lioncash/sign
gl_shader_manager: Amend sign differences in an assertion comparison in SetShaderUniformBlockBinding()
This commit is contained in:
commit
13d6593753
|
@ -13,15 +13,16 @@ namespace Impl {
|
||||||
static void SetShaderUniformBlockBinding(GLuint shader, const char* name,
|
static void SetShaderUniformBlockBinding(GLuint shader, const char* name,
|
||||||
Maxwell3D::Regs::ShaderStage binding,
|
Maxwell3D::Regs::ShaderStage binding,
|
||||||
size_t expected_size) {
|
size_t expected_size) {
|
||||||
GLuint ub_index = glGetUniformBlockIndex(shader, name);
|
const GLuint ub_index = glGetUniformBlockIndex(shader, name);
|
||||||
if (ub_index != GL_INVALID_INDEX) {
|
if (ub_index == GL_INVALID_INDEX) {
|
||||||
GLint ub_size = 0;
|
return;
|
||||||
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));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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) {
|
void SetShaderUniformBlockBindings(GLuint shader) {
|
||||||
|
|
Loading…
Reference in a new issue