mesa: don't try to re-generate the default buffer
authorTimothy Arceri <tarceri@itsqueeze.com>
Tue, 25 Jul 2017 13:06:03 +0000 (23:06 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Wed, 26 Jul 2017 00:16:20 +0000 (10:16 +1000)
It should have been created by this point.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/mesa/main/bufferobj.c

index 419972e37127137eec4f09f72debf640ed744de2..12fe2d31436a47b5c5f9175fab6553d95fc381a0 100644 (file)
@@ -4041,10 +4041,10 @@ bind_buffer_range(GLenum target, GLuint index, GLuint buffer, GLintptr offset,
       bufObj = ctx->Shared->NullBufferObj;
    } else {
       bufObj = _mesa_lookup_bufferobj(ctx, buffer);
+      if (!_mesa_handle_bind_buffer_gen(ctx, buffer,
+                                        &bufObj, "glBindBufferRange"))
+         return;
    }
-   if (!_mesa_handle_bind_buffer_gen(ctx, buffer,
-                                     &bufObj, "glBindBufferRange"))
-      return;
 
    if (no_error) {
       switch (target) {
@@ -4139,10 +4139,10 @@ _mesa_BindBufferBase(GLenum target, GLuint index, GLuint buffer)
       bufObj = ctx->Shared->NullBufferObj;
    } else {
       bufObj = _mesa_lookup_bufferobj(ctx, buffer);
+      if (!_mesa_handle_bind_buffer_gen(ctx, buffer,
+                                        &bufObj, "glBindBufferBase"))
+         return;
    }
-   if (!_mesa_handle_bind_buffer_gen(ctx, buffer,
-                                     &bufObj, "glBindBufferBase"))
-      return;
 
    if (!bufObj) {
       _mesa_error(ctx, GL_INVALID_OPERATION,