From 50533d408db1048a148012e2c3e1be5aca2ae93d Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Wed, 11 Sep 2019 10:26:50 +0200 Subject: [PATCH] mesa: add EXT_dsa NamedCopyBufferSubDataEXT function MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák --- .../glapi/gen/EXT_direct_state_access.xml | 8 +++++++ src/mapi/glapi/gen/static_data.py | 1 + src/mesa/main/bufferobj.c | 24 +++++++++++++++++++ src/mesa/main/bufferobj.h | 5 ++++ src/mesa/main/tests/dispatch_sanity.cpp | 4 ++-- 5 files changed, 40 insertions(+), 2 deletions(-) diff --git a/src/mapi/glapi/gen/EXT_direct_state_access.xml b/src/mapi/glapi/gen/EXT_direct_state_access.xml index d926b25014d..336f3ad5289 100644 --- a/src/mapi/glapi/gen/EXT_direct_state_access.xml +++ b/src/mapi/glapi/gen/EXT_direct_state_access.xml @@ -1044,6 +1044,14 @@ + + + + + + + + diff --git a/src/mapi/glapi/gen/static_data.py b/src/mapi/glapi/gen/static_data.py index 344f476a676..01bc6ed95ea 100644 --- a/src/mapi/glapi/gen/static_data.py +++ b/src/mapi/glapi/gen/static_data.py @@ -1596,6 +1596,7 @@ offsets = { "GenerateTextureMipmapEXT": 1560, "GenerateMultiTexMipmapEXT": 1561, "NamedRenderbufferStorageMultisampleEXT": 1562, + "NamedCopyBufferSubDataEXT": 1563, } functions = [ diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index bffca3c898d..e370d04c31d 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -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, diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h index dc752fab477..6cc04eb4bb8 100644 --- a/src/mesa/main/bufferobj.h +++ b/src/mesa/main/bufferobj.h @@ -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, diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp index 3ff13085894..5f3e25a2c5b 100644 --- a/src/mesa/main/tests/dispatch_sanity.cpp +++ b/src/mesa/main/tests/dispatch_sanity.cpp @@ -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 }, -- 2.30.2