mesa: add Driver.InvalidateBufferSubData
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Sat, 9 Jan 2016 22:53:07 +0000 (17:53 -0500)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 14 Jan 2016 14:39:30 +0000 (09:39 -0500)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/bufferobj.c
src/mesa/main/dd.h

index aa2498bf5f56d6800de6c876f0311726470f6cdf..26f873bc9a97c55c7f4742fd02ddd35f8a75b2d5 100644 (file)
@@ -3939,10 +3939,8 @@ _mesa_InvalidateBufferSubData(GLuint buffer, GLintptr offset,
       return;
    }
 
-   /* We don't actually do anything for this yet.  Just return after
-    * validating the parameters and generating the required errors.
-    */
-   return;
+   if (ctx->Driver.InvalidateBufferSubData)
+      ctx->Driver.InvalidateBufferSubData(ctx, bufObj, offset, length);
 }
 
 void GLAPIENTRY
@@ -3979,8 +3977,6 @@ _mesa_InvalidateBufferData(GLuint buffer)
       return;
    }
 
-   /* We don't actually do anything for this yet.  Just return after
-    * validating the parameters and generating the required errors.
-    */
-   return;
+   if (ctx->Driver.InvalidateBufferSubData)
+      ctx->Driver.InvalidateBufferSubData(ctx, bufObj, 0, bufObj->Size);
 }
index e5281ce9744134304aa09a4a0e2ba8836e758bf7..70ed5633f7b2f96a3682dbaeab876978ff7aff77 100644 (file)
@@ -634,6 +634,11 @@ struct dd_function_table {
                               GLintptr readOffset, GLintptr writeOffset,
                               GLsizeiptr size );
 
+   void (*InvalidateBufferSubData)( struct gl_context *ctx,
+                                    struct gl_buffer_object *obj,
+                                    GLintptr offset,
+                                    GLsizeiptr length );
+
    /* Returns pointer to the start of the mapped range.
     * May return NULL if MESA_MAP_NOWAIT_BIT is set in access:
     */