mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 15:20:10 +01:00
glsl: fix UNIFORM_BUFFER_START or UNIFORM_BUFFER_SIZE query when no buffer object is bound
According to ARB_uniform_buffer_object spec: "If the parameter (starting offset or size) was not specified when the buffer object was bound (e.g. if bound with BindBufferBase), or if no buffer object is bound to <index>, zero is returned." Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
This commit is contained in:
parent
2e16dd1350
commit
3b2037f88c
1 changed files with 4 additions and 2 deletions
|
|
@ -1932,7 +1932,8 @@ find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v)
|
|||
goto invalid_value;
|
||||
if (!ctx->Extensions.ARB_uniform_buffer_object)
|
||||
goto invalid_enum;
|
||||
v->value_int = ctx->UniformBufferBindings[index].Offset;
|
||||
v->value_int = ctx->UniformBufferBindings[index].Offset < 0 ? 0 :
|
||||
ctx->UniformBufferBindings[index].Offset;
|
||||
return TYPE_INT;
|
||||
|
||||
case GL_UNIFORM_BUFFER_SIZE:
|
||||
|
|
@ -1940,7 +1941,8 @@ find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v)
|
|||
goto invalid_value;
|
||||
if (!ctx->Extensions.ARB_uniform_buffer_object)
|
||||
goto invalid_enum;
|
||||
v->value_int = ctx->UniformBufferBindings[index].Size;
|
||||
v->value_int = ctx->UniformBufferBindings[index].Size < 0 ? 0 :
|
||||
ctx->UniformBufferBindings[index].Size;
|
||||
return TYPE_INT;
|
||||
|
||||
/* ARB_shader_storage_buffer_object */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue