diff options
-rw-r--r-- | src/mesa/main/transformfeedback.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c index f2c1435d9e7..1bd76d130fd 100644 --- a/src/mesa/main/transformfeedback.c +++ b/src/mesa/main/transformfeedback.c @@ -470,7 +470,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); @@ -518,7 +523,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); @@ -574,7 +584,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); |