mesa: add EXT_dsa NamedCopyBufferSubDataEXT function
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Wed, 11 Sep 2019 08:26:50 +0000 (10:26 +0200)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Fri, 18 Oct 2019 08:26:26 +0000 (10:26 +0200)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mapi/glapi/gen/EXT_direct_state_access.xml
src/mapi/glapi/gen/static_data.py
src/mesa/main/bufferobj.c
src/mesa/main/bufferobj.h
src/mesa/main/tests/dispatch_sanity.cpp

index d926b25014da18516110ecfa334b04939aad1b2b..336f3ad52899d2a75f0d7ff42aac3229d11de08e 100644 (file)
       <param name="height" type="GLsizei" />
    </function>
 
+   <function name="NamedCopyBufferSubDataEXT">
+      <param name="readBuffer" type="GLuint" />
+      <param name="writeBuffer" type="GLuint" />
+      <param name="readOffset" type="GLintptr" />
+      <param name="writeOffset" type="GLintptr" />
+      <param name="size" type="GLsizeiptr" />
+   </function>
+
    <!-- ARB_vertex_program -->
    <function name="NamedProgramStringEXT">
       <param name="program" type="GLuint" />
index 344f476a676de263bcaebc27ba4e87c8ef916f66..01bc6ed95ea85bd52a116467bd633a6402cb8b30 100644 (file)
@@ -1596,6 +1596,7 @@ offsets = {
     "GenerateTextureMipmapEXT": 1560,
     "GenerateMultiTexMipmapEXT": 1561,
     "NamedRenderbufferStorageMultisampleEXT": 1562,
+    "NamedCopyBufferSubDataEXT": 1563,
 }
 
 functions = [
index bffca3c898d4067204acb960f6c9fe569d6797f3..e370d04c31d675ebf797bc4c803a90e4adda9d0d 100644 (file)
@@ -3090,6 +3090,30 @@ _mesa_CopyBufferSubData(GLenum readTarget, GLenum writeTarget,
                         "glCopyBufferSubData");
 }
 
+void GLAPIENTRY
+_mesa_NamedCopyBufferSubDataEXT(GLuint readBuffer, GLuint writeBuffer,
+                                GLintptr readOffset, GLintptr writeOffset,
+                                GLsizeiptr size)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_buffer_object *src, *dst;
+
+   src = _mesa_lookup_bufferobj(ctx, readBuffer);
+   if (!_mesa_handle_bind_buffer_gen(ctx, readBuffer,
+                                     &src,
+                                     "glNamedCopyBufferSubDataEXT"))
+      return;
+
+   dst = _mesa_lookup_bufferobj(ctx, writeBuffer);
+   if (!_mesa_handle_bind_buffer_gen(ctx, writeBuffer,
+                                     &dst,
+                                     "glNamedCopyBufferSubDataEXT"))
+      return;
+
+   copy_buffer_sub_data(ctx, src, dst, readOffset, writeOffset, size,
+                        "glNamedCopyBufferSubDataEXT");
+}
+
 void GLAPIENTRY
 _mesa_CopyNamedBufferSubData_no_error(GLuint readBuffer, GLuint writeBuffer,
                                       GLintptr readOffset,
index dc752fab477a2d6d1a85b3d23f68bf40c41b338f..6cc04eb4bb882173304e5d0ca227f84e7fcca8cd 100644 (file)
@@ -345,6 +345,11 @@ _mesa_CopyBufferSubData(GLenum readTarget, GLenum writeTarget,
                         GLintptr readOffset, GLintptr writeOffset,
                         GLsizeiptr size);
 
+void GLAPIENTRY
+_mesa_NamedCopyBufferSubDataEXT(GLuint readBuffer, GLuint writeBuffer,
+                                GLintptr readOffset, GLintptr writeOffset,
+                                GLsizeiptr size);
+
 void GLAPIENTRY
 _mesa_CopyNamedBufferSubData_no_error(GLuint readBuffer, GLuint writeBuffer,
                                       GLintptr readOffset,
index 3ff130858942f908e711585c0f30257e82e3c684..5f3e25a2c5b9039cc3c72191cff16e850c6725a7 100644 (file)
@@ -1155,7 +1155,7 @@ const struct function common_desktop_functions_possible[] = {
    /* GL_EXT_direct_state_access - GL 3.0 */
    { "glNamedRenderbufferStorageEXT", 30, -1 },
    { "glGetNamedRenderbufferParameterivEXT", 30, -1 },
-   //{ "glNamedRenderbufferStorageMultisampleEXT", 30, -1 },
+   { "glNamedRenderbufferStorageMultisampleEXT", 30, -1 },
    { "glCheckNamedFramebufferStatusEXT", 30, -1 },
    { "glNamedFramebufferTexture1DEXT", 30, -1 },
    { "glNamedFramebufferTexture2DEXT", 30, -1 },
@@ -1168,7 +1168,7 @@ const struct function common_desktop_functions_possible[] = {
    { "glFramebufferDrawBuffersEXT", 30, -1 },
    { "glFramebufferReadBufferEXT", 30, -1 },
    { "glGetFramebufferParameterivEXT", 30, -1 },
-   //{ "glNamedCopyBufferSubDataEXT", 30, -1 },
+   { "glNamedCopyBufferSubDataEXT", 30, -1 },
    //{ "glVertexArrayVertexOffsetEXT", 30, -1 },
    //{ "glVertexArrayColorOffsetEXT", 30, -1 },
    //{ "glVertexArrayEdgeFlagOffsetEXT", 30, -1 },