mesa: add ARB_vertex_attrib_64bit VertexArrayVertexAttribLOffsetEXT
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Tue, 5 Nov 2019 14:04:52 +0000 (15:04 +0100)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Tue, 19 Nov 2019 07:49:44 +0000 (08:49 +0100)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
docs/features.txt
src/mapi/glapi/gen/ARB_vertex_attrib_64bit.xml
src/mapi/glapi/gen/static_data.py
src/mesa/main/tests/dispatch_sanity.cpp
src/mesa/main/varray.c
src/mesa/main/varray.h

index 9463b17a0435cf1e61ac34c7777fc23dc5a19f68..0193aba5cf000c7e2942a78febe69a01d4c25b6d 100644 (file)
@@ -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
index 6d76003fec8031d6e624ac14dc4df777c9ba3153..4d66ee50c80662139575be63edee6d116e306d1a 100644 (file)
         <param name="pname" type="GLenum"/>
         <param name="params" type="GLdouble *"/>
     </function>
+
+    <function name="VertexArrayVertexAttribLOffsetEXT">
+        <param name="vaobj" type="GLuint" />
+        <param name="buffer" type="GLuint" />
+        <param name="index" type="GLuint" />
+        <param name="size" type="GLint" />
+        <param name="type" type="GLenum" />
+        <param name="stride" type="GLsizei" />
+        <param name="offset" type="GLintptr" />
+    </function>
 </category>
 
 </OpenGLAPI>
index fe9f94ae97f08c1ad56c7dd3252a4d777e6a656b..9937b7aaa4ef2bade564bc7e9764a85b1bf8d6c6 100644 (file)
@@ -1618,6 +1618,7 @@ offsets = {
     "GetVertexArrayPointeri_vEXT": 1582,
     "NamedFramebufferParameteriEXT": 1583,
     "GetNamedFramebufferParameterivEXT": 1584,
+    "VertexArrayVertexAttribLOffsetEXT": 1585,
 }
 
 functions = [
index 390e3ef381f7adb6e2ce715a1a2af3ced2fa2366..6df90e966f1f72b7da4ac4be7aa2ee793cdf4c88 100644 (file)
@@ -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 },
index 17d5288b6f2f1f1b0975c390ffc5001b37cc49ef..8db6f13a3199a8024e6d88f88d02735d2a630561 100644 (file)
@@ -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)
index ecb463f42d3085bfd82adf67601fc15f90a17203..fb490f1a586469855dd8cf6523269becdbb9b872 100644 (file)
@@ -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);