From 442fd3d007d733a24e8d2473756467d616a134ac Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Tue, 5 Nov 2019 15:04:52 +0100 Subject: [PATCH] mesa: add ARB_vertex_attrib_64bit VertexArrayVertexAttribLOffsetEXT MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák --- docs/features.txt | 4 +-- .../glapi/gen/ARB_vertex_attrib_64bit.xml | 10 ++++++ src/mapi/glapi/gen/static_data.py | 1 + src/mesa/main/tests/dispatch_sanity.cpp | 1 + src/mesa/main/varray.c | 34 +++++++++++++++++++ src/mesa/main/varray.h | 4 +++ 6 files changed, 52 insertions(+), 2 deletions(-) diff --git a/docs/features.txt b/docs/features.txt index 9463b17a043..0193aba5cf0 100644 --- a/docs/features.txt +++ b/docs/features.txt @@ -387,14 +387,14 @@ GL_EXT_direct_state_access additions from other extensions (complete list): GL_ARB_texture_buffer_range not started GL_ARB_texture_storage DONE GL_ARB_texture_storage_multisample not started - GL_ARB_vertex_attrib_64bit not started + GL_ARB_vertex_attrib_64bit DONE GL_ARB_vertex_attrib_binding DONE GL_EXT_buffer_storage DONE GL_EXT_external_buffer n/a GL_EXT_separate_shader_objects n/a GL_EXT_sparse_texture n/a GL_EXT_texture_storage n/a - GL_EXT_vertex_attrib_64bit not started + GL_EXT_vertex_attrib_64bit DONE GL_EXT_EGL_image_storage n/a GL_NV_bindless_texture n/a GL_NV_gpu_shader5 n/a diff --git a/src/mapi/glapi/gen/ARB_vertex_attrib_64bit.xml b/src/mapi/glapi/gen/ARB_vertex_attrib_64bit.xml index 6d76003fec8..4d66ee50c80 100644 --- a/src/mapi/glapi/gen/ARB_vertex_attrib_64bit.xml +++ b/src/mapi/glapi/gen/ARB_vertex_attrib_64bit.xml @@ -64,6 +64,16 @@ + + + + + + + + + + diff --git a/src/mapi/glapi/gen/static_data.py b/src/mapi/glapi/gen/static_data.py index fe9f94ae97f..9937b7aaa4e 100644 --- a/src/mapi/glapi/gen/static_data.py +++ b/src/mapi/glapi/gen/static_data.py @@ -1618,6 +1618,7 @@ offsets = { "GetVertexArrayPointeri_vEXT": 1582, "NamedFramebufferParameteriEXT": 1583, "GetNamedFramebufferParameterivEXT": 1584, + "VertexArrayVertexAttribLOffsetEXT": 1585, } functions = [ diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp index 390e3ef381f..6df90e966f1 100644 --- a/src/mesa/main/tests/dispatch_sanity.cpp +++ b/src/mesa/main/tests/dispatch_sanity.cpp @@ -616,6 +616,7 @@ const struct function common_desktop_functions_possible[] = { { "glVertexAttribL4dv", 41, -1 }, { "glVertexAttribLPointer", 41, -1 }, { "glGetVertexAttribLdv", 41, -1 }, + { "glVertexArrayVertexAttribLOffsetEXT", 41, -1 }, /* GL 4.3 */ { "glIsRenderbuffer", 43, -1 }, diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index 17d5288b6f2..8db6f13a319 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -1410,6 +1410,40 @@ _mesa_VertexArrayVertexAttribOffsetEXT(GLuint vaobj, GLuint buffer, GLuint index } +void GLAPIENTRY +_mesa_VertexArrayVertexAttribLOffsetEXT(GLuint vaobj, GLuint buffer, GLuint index, GLint size, + GLenum type, GLsizei stride, GLintptr offset) +{ + GET_CURRENT_CONTEXT(ctx); + GLenum format = GL_RGBA; + struct gl_vertex_array_object* vao; + struct gl_buffer_object* vbo; + + if (!_lookup_vao_and_vbo_dsa(ctx, vaobj, buffer, offset, + &vao, &vbo, + "glVertexArrayVertexAttribLOffsetEXT")) + return; + + if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) { + _mesa_error(ctx, GL_INVALID_VALUE, "glVertexArrayVertexAttribLOffsetEXT(idx)"); + return; + } + + const GLbitfield legalTypes = DOUBLE_BIT; + + if (!validate_array_and_format(ctx, "glVertexArrayVertexAttribLOffsetEXT", + vao, vbo, + VERT_ATTRIB_GENERIC(index), legalTypes, + 1, 4, size, type, stride, + GL_FALSE, GL_FALSE, GL_TRUE, format, (void*) offset)) + return; + + update_array(ctx, vao, vbo, + VERT_ATTRIB_GENERIC(index), format, 4, + size, type, stride, GL_FALSE, GL_FALSE, GL_TRUE, (void*) offset); +} + + void GLAPIENTRY _mesa_VertexAttribIPointer_no_error(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) diff --git a/src/mesa/main/varray.h b/src/mesa/main/varray.h index ecb463f42d3..fb490f1a586 100644 --- a/src/mesa/main/varray.h +++ b/src/mesa/main/varray.h @@ -494,6 +494,10 @@ extern void GLAPIENTRY _mesa_VertexArrayVertexAttribIOffsetEXT(GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +extern void GLAPIENTRY +_mesa_VertexArrayVertexAttribLOffsetEXT(GLuint vaobj, GLuint buffer, GLuint index, GLint size, + GLenum type, GLsizei stride, GLintptr offset); + extern void GLAPIENTRY _mesa_GetVertexArrayIntegervEXT(GLuint vaobj, GLenum pname, GLint *param); -- 2.30.2