mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-29 16:00:24 +01:00
mesa: Support BindBuffer{Base,Offset,Range} with a buffer of 0.
_mesa_lookup_bufferobj returns NULL for 0, which caused us to say
"there's no such buffer object" and raise an error, rather than
correctly binding the shared NullBufferObj.
Now you can unbind your buffers.
NOTE: This is a candidate for stable release branches.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 05b086ce93)
This commit is contained in:
parent
a8fed44e9e
commit
5fde348eb8
1 changed files with 18 additions and 3 deletions
|
|
@ -497,7 +497,12 @@ _mesa_BindBufferRange(GLenum target, GLuint index,
|
|||
return;
|
||||
}
|
||||
|
||||
bufObj = _mesa_lookup_bufferobj(ctx, buffer);
|
||||
if (buffer == 0) {
|
||||
bufObj = ctx->Shared->NullBufferObj;
|
||||
} else {
|
||||
bufObj = _mesa_lookup_bufferobj(ctx, buffer);
|
||||
}
|
||||
|
||||
if (!bufObj) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
"glBindBufferRange(invalid buffer=%u)", buffer);
|
||||
|
|
@ -545,7 +550,12 @@ _mesa_BindBufferBase(GLenum target, GLuint index, GLuint buffer)
|
|||
return;
|
||||
}
|
||||
|
||||
bufObj = _mesa_lookup_bufferobj(ctx, buffer);
|
||||
if (buffer == 0) {
|
||||
bufObj = ctx->Shared->NullBufferObj;
|
||||
} else {
|
||||
bufObj = _mesa_lookup_bufferobj(ctx, buffer);
|
||||
}
|
||||
|
||||
if (!bufObj) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
"glBindBufferBase(invalid buffer=%u)", buffer);
|
||||
|
|
@ -601,7 +611,12 @@ _mesa_BindBufferOffsetEXT(GLenum target, GLuint index, GLuint buffer,
|
|||
return;
|
||||
}
|
||||
|
||||
bufObj = _mesa_lookup_bufferobj(ctx, buffer);
|
||||
if (buffer == 0) {
|
||||
bufObj = ctx->Shared->NullBufferObj;
|
||||
} else {
|
||||
bufObj = _mesa_lookup_bufferobj(ctx, buffer);
|
||||
}
|
||||
|
||||
if (!bufObj) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
"glBindBufferOffsetEXT(invalid buffer=%u)", buffer);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue