main: Improve errors and style in BufferSubData.
authorLaura Ekstrand <laura@jlekstrand.net>
Wed, 11 Feb 2015 19:06:42 +0000 (11:06 -0800)
committerLaura Ekstrand <laura@jlekstrand.net>
Tue, 17 Mar 2015 17:18:33 +0000 (10:18 -0700)
- More explicit error reporting.
- Removed legacy style.

Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
src/mesa/main/bufferobj.c
src/mesa/main/bufferobj.h

index 5153679ea6c9434c63accac28a8361522d08292f..f6bc333c828350e0a98aebdd7d43a7ddfe08e438 100644 (file)
@@ -272,13 +272,17 @@ buffer_object_subdata_range_good(struct gl_context *ctx,
 
    if (mappedRange) {
       if (bufferobj_range_mapped(bufObj, offset, size)) {
-         _mesa_error(ctx, GL_INVALID_OPERATION, "%s", caller);
+         _mesa_error(ctx, GL_INVALID_OPERATION,
+                     "%s(range is mapped without persistent bit)",
+                     caller);
          return false;
       }
    }
    else {
       if (_mesa_bufferobj_mapped(bufObj, MAP_USER)) {
-         _mesa_error(ctx, GL_INVALID_OPERATION, "%s", caller);
+         _mesa_error(ctx, GL_INVALID_OPERATION,
+                     "%s(buffer is mapped without persistent bit)",
+                     caller);
          return false;
       }
    }
@@ -1642,7 +1646,7 @@ _mesa_buffer_sub_data(struct gl_context *ctx, struct gl_buffer_object *bufObj,
    bufObj->Written = GL_TRUE;
 
    assert(ctx->Driver.BufferSubData);
-   ctx->Driver.BufferSubData( ctx, offset, size, data, bufObj );
+   ctx->Driver.BufferSubData(ctx, offset, size, data, bufObj);
 }
 
 void GLAPIENTRY
index 889bbb18a20effe93985ee806a50bca0a28b26de..d15ad004e589d5c6bb6a2c42d74411f1c7f56f54 100644 (file)
@@ -190,8 +190,8 @@ _mesa_NamedBufferData(GLuint buffer, GLsizeiptr size,
                       const GLvoid *data, GLenum usage);
 
 void GLAPIENTRY
-_mesa_BufferSubData(GLenum target, GLintptrARB offset,
-                    GLsizeiptrARB size, const GLvoid * data);
+_mesa_BufferSubData(GLenum target, GLintptr offset,
+                    GLsizeiptr size, const GLvoid *data);
 
 void GLAPIENTRY
 _mesa_NamedBufferSubData(GLuint buffer, GLintptr offset,