mesa: add uniform_block_binding() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
This commit is contained in:
parent
f543107256
commit
277135c1ed
|
@ -1085,6 +1085,21 @@ _mesa_GetUniformIndices(GLuint program,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
uniform_block_binding(struct gl_context *ctx, struct gl_shader_program *shProg,
|
||||||
|
GLuint uniformBlockIndex, GLuint uniformBlockBinding)
|
||||||
|
{
|
||||||
|
if (shProg->data->UniformBlocks[uniformBlockIndex].Binding !=
|
||||||
|
uniformBlockBinding) {
|
||||||
|
|
||||||
|
FLUSH_VERTICES(ctx, 0);
|
||||||
|
ctx->NewDriverState |= ctx->DriverFlags.NewUniformBuffer;
|
||||||
|
|
||||||
|
shProg->data->UniformBlocks[uniformBlockIndex].Binding =
|
||||||
|
uniformBlockBinding;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GLAPIENTRY
|
void GLAPIENTRY
|
||||||
_mesa_UniformBlockBinding(GLuint program,
|
_mesa_UniformBlockBinding(GLuint program,
|
||||||
GLuint uniformBlockIndex,
|
GLuint uniformBlockIndex,
|
||||||
|
@ -1117,15 +1132,7 @@ _mesa_UniformBlockBinding(GLuint program,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shProg->data->UniformBlocks[uniformBlockIndex].Binding !=
|
uniform_block_binding(ctx, shProg, uniformBlockIndex, uniformBlockBinding);
|
||||||
uniformBlockBinding) {
|
|
||||||
|
|
||||||
FLUSH_VERTICES(ctx, 0);
|
|
||||||
ctx->NewDriverState |= ctx->DriverFlags.NewUniformBuffer;
|
|
||||||
|
|
||||||
shProg->data->UniformBlocks[uniformBlockIndex].Binding =
|
|
||||||
uniformBlockBinding;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLAPIENTRY
|
void GLAPIENTRY
|
||||||
|
|
Loading…
Reference in New Issue