glthread: don't execute any custom VAO and BindBuffer code in the Core profile
authorMarek Olšák <marek.olsak@amd.com>
Wed, 4 Mar 2020 20:02:15 +0000 (15:02 -0500)
committerMarge Bot <eric+marge@anholt.net>
Fri, 20 Mar 2020 00:00:22 +0000 (00:00 +0000)
It's not needed, because user pointers can never occur there.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4251>

src/mapi/glapi/gen/ARB_direct_state_access.xml
src/mapi/glapi/gen/ARB_vertex_array_object.xml
src/mapi/glapi/gen/ARB_vertex_attrib_64bit.xml
src/mapi/glapi/gen/EXT_direct_state_access.xml
src/mapi/glapi/gen/GL3x.xml
src/mapi/glapi/gen/es_EXT.xml
src/mapi/glapi/gen/gl_API.xml
src/mapi/glapi/gen/gl_marshal.py
src/mesa/main/glthread_varray.c

index ead893e1c678ba553bd186f3f6b5bef91cc17c25..ec7b13609a188b6f76787e4728c0961ab77c6fce 100644 (file)
    <!-- Vertex Array object functions -->
 
    <function name="CreateVertexArrays" no_error="true"
-             marshal_call_after="_mesa_glthread_GenVertexArrays(ctx, n, arrays);">
+             marshal_call_after="if (COMPAT) _mesa_glthread_GenVertexArrays(ctx, n, arrays);">
       <param name="n" type="GLsizei" />
       <param name="arrays" type="GLuint *" />
    </function>
index e149997d05ce0fe315ed48d0fb454815fa3249b6..ba011987e8ddd601966c84fabe5e051f071fef6b 100644 (file)
     <enum name="VERTEX_ARRAY_BINDING" value="0x85B5"/>
 
     <function name="BindVertexArray" es2="3.0" no_error="true"
-              marshal_call_after="_mesa_glthread_BindVertexArray(ctx, array);">
+              marshal_call_after="if (COMPAT) _mesa_glthread_BindVertexArray(ctx, array);">
         <param name="array" type="GLuint"/>
     </function>
 
     <function name="DeleteVertexArrays" es2="3.0" no_error="true"
-              marshal_call_after="_mesa_glthread_DeleteVertexArrays(ctx, n, arrays);">
+              marshal_call_after="if (COMPAT) _mesa_glthread_DeleteVertexArrays(ctx, n, arrays);">
         <param name="n" type="GLsizei"/>
         <param name="arrays" type="const GLuint *" count="n"/>
     </function>
 
     <function name="GenVertexArrays" es2="3.0" no_error="true"
-              marshal_call_after="_mesa_glthread_GenVertexArrays(ctx, n, arrays);">
+              marshal_call_after="if (COMPAT) _mesa_glthread_GenVertexArrays(ctx, n, arrays);">
         <param name="n" type="GLsizei"/>
         <param name="arrays" type="GLuint *"/>
     </function>
index 1342e7e777ed07861a361361442bcc30477ec7cb..45c30f4837862e61a194b1d9ebcfe8cb4e6d2e25 100644 (file)
@@ -52,7 +52,7 @@
     </function>
 
     <function name="VertexAttribLPointer" no_error="true" marshal="async"
-              marshal_call_after="_mesa_glthread_AttribPointer(ctx);">
+              marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx);">
         <param name="index" type="GLuint"/>
         <param name="size" type="GLint"/>
         <param name="type" type="GLenum"/>
index 3888dd34e6e25bdf4ea212d6e90c9b87367c8467..397c75a37d0352e3f98df5e51ee7fbdd98358516 100644 (file)
    </function>
 
    <function name="MultiTexCoordPointerEXT" marshal="async"
-             marshal_call_after="_mesa_glthread_AttribPointer(ctx);">
+             marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx);">
       <param name="texunit" type="GLenum" />
       <param name="size" type="GLint" />
       <param name="type" type="GLenum" />
index 16035adc01d16a780faeaec3056edbfa7fae88db..943e5289a9343c17ddf8247ea6abb37e3c48adea 100644 (file)
 
   <function name="VertexAttribIPointer" es2="3.0" marshal="async"
             no_error="true"
-            marshal_call_after="_mesa_glthread_AttribPointer(ctx);">
+            marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx);">
     <param name="index" type="GLuint"/>
     <param name="size" type="GLint"/>
     <param name="type" type="GLenum"/>
index 9dc1444bafec1ff1aef3207c8fc506e34f712db3..107ca9a2cb0cae6779cde245a93c49bdcd46cbcc 100644 (file)
 
     <function name="PointSizePointerOES" es1="1.0" desktop="false"
               no_error="true" marshal="async"
-              marshal_call_after="_mesa_glthread_AttribPointer(ctx);">
+              marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx);">
         <param name="type" type="GLenum"/>
         <param name="stride" type="GLsizei"/>
         <param name="pointer" type="const GLvoid *"/>
index 3a703f2a3d4c02aefa5c4278aae62b5dfec7ef37..7d6e01eb031c06d2bc955b6d584ba3323ce1e79e 100644 (file)
 
     <function name="ColorPointer" es1="1.0" deprecated="3.1" marshal="async"
               no_error="true"
-              marshal_call_after="_mesa_glthread_AttribPointer(ctx);">
+              marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx);">
         <param name="size" type="GLint"/>
         <param name="type" type="GLenum"/>
         <param name="stride" type="GLsizei"/>
 
     <function name="EdgeFlagPointer" deprecated="3.1" marshal="async"
               no_error="true"
-              marshal_call_after="_mesa_glthread_AttribPointer(ctx);">
+              marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx);">
         <param name="stride" type="GLsizei"/>
         <param name="pointer" type="const GLvoid *"/>
         <glx handcode="true"/>
 
     <function name="IndexPointer" deprecated="3.1" marshal="async"
               no_error="true"
-              marshal_call_after="_mesa_glthread_AttribPointer(ctx);">
+              marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx);">
         <param name="type" type="GLenum"/>
         <param name="stride" type="GLsizei"/>
         <param name="pointer" type="const GLvoid *"/>
 
     <function name="NormalPointer" es1="1.0" deprecated="3.1" marshal="async"
               no_error="true"
-              marshal_call_after="_mesa_glthread_AttribPointer(ctx);">
+              marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx);">
         <param name="type" type="GLenum"/>
         <param name="stride" type="GLsizei"/>
         <param name="pointer" type="const GLvoid *"/>
 
     <function name="TexCoordPointer" es1="1.0" deprecated="3.1" marshal="async"
               no_error="true"
-              marshal_call_after="_mesa_glthread_AttribPointer(ctx);">
+              marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx);">
         <param name="size" type="GLint"/>
         <param name="type" type="GLenum"/>
         <param name="stride" type="GLsizei"/>
 
     <function name="VertexPointer" es1="1.0" deprecated="3.1" marshal="async"
               no_error="true"
-              marshal_call_after="_mesa_glthread_AttribPointer(ctx);">
+              marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx);">
         <param name="size" type="GLint"/>
         <param name="type" type="GLenum"/>
         <param name="stride" type="GLsizei"/>
 
     <function name="FogCoordPointer" deprecated="3.1" marshal="async"
               no_error="true"
-              marshal_call_after="_mesa_glthread_AttribPointer(ctx);">
+              marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx);">
         <param name="type" type="GLenum"/>
         <param name="stride" type="GLsizei"/>
         <param name="pointer" type="const GLvoid *"/>
 
     <function name="SecondaryColorPointer" deprecated="3.1" marshal="async"
               no_error="true"
-              marshal_call_after="_mesa_glthread_AttribPointer(ctx);">
+              marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx);">
         <param name="size" type="GLint"/>
         <param name="type" type="GLenum"/>
         <param name="stride" type="GLsizei"/>
     <type name="sizeiptr" size="4"  unsigned="true" glx_name="CARD32"/>
 
     <function name="BindBuffer" es1="1.1" es2="2.0" no_error="true"
-              marshal_call_after="_mesa_glthread_BindBuffer(ctx, target, buffer);">
+              marshal_call_after="if (COMPAT) _mesa_glthread_BindBuffer(ctx, target, buffer);">
         <param name="target" type="GLenum"/>
         <param name="buffer" type="GLuint"/>
         <glx ignore="true"/>
 
     <function name="VertexAttribPointer" es2="2.0" marshal="async"
               no_error="true"
-              marshal_call_after="_mesa_glthread_AttribPointer(ctx);">
+              marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx);">
         <param name="index" type="GLuint"/>
         <param name="size" type="GLint"/>
         <param name="type" type="GLenum"/>
     </function>
 
     <function name="ColorPointerEXT" deprecated="3.1" marshal="async"
-              marshal_call_after="_mesa_glthread_AttribPointer(ctx);">
+              marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx);">
         <param name="size" type="GLint"/>
         <param name="type" type="GLenum"/>
         <param name="stride" type="GLsizei"/>
     </function>
 
     <function name="EdgeFlagPointerEXT" deprecated="3.1" marshal="async"
-              marshal_call_after="_mesa_glthread_AttribPointer(ctx);">
+              marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx);">
         <param name="stride" type="GLsizei"/>
         <param name="count" type="GLsizei"/>
         <param name="pointer" type="const GLboolean *"/>
     </function>
 
     <function name="IndexPointerEXT" deprecated="3.1" marshal="async"
-              marshal_call_after="_mesa_glthread_AttribPointer(ctx);">
+              marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx);">
         <param name="type" type="GLenum"/>
         <param name="stride" type="GLsizei"/>
         <param name="count" type="GLsizei"/>
     </function>
 
     <function name="NormalPointerEXT" deprecated="3.1" marshal="async"
-              marshal_call_after="_mesa_glthread_AttribPointer(ctx);">
+              marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx);">
         <param name="type" type="GLenum"/>
         <param name="stride" type="GLsizei"/>
         <param name="count" type="GLsizei"/>
     </function>
 
     <function name="TexCoordPointerEXT" deprecated="3.1" marshal="async"
-              marshal_call_after="_mesa_glthread_AttribPointer(ctx);">
+              marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx);">
         <param name="size" type="GLint"/>
         <param name="type" type="GLenum"/>
         <param name="stride" type="GLsizei"/>
     </function>
 
     <function name="VertexPointerEXT" deprecated="3.1" marshal="async"
-              marshal_call_after="_mesa_glthread_AttribPointer(ctx);">
+              marshal_call_after="if (COMPAT) _mesa_glthread_AttribPointer(ctx);">
         <param name="size" type="GLint"/>
         <param name="type" type="GLenum"/>
         <param name="stride" type="GLsizei"/>
index 05c4e28eec178e18c6d2d1ba4e7a34b77984bade..02c94dd74dbd31aa72c1f0fe6be3a60ec9fe17d2 100644 (file)
@@ -35,6 +35,8 @@ header = """
 #include "dispatch.h"
 #include "glthread.h"
 #include "marshal.h"
+
+#define COMPAT (ctx->API != API_OPENGL_CORE)
 """
 
 
index 8786f0f2d09124841ed0dd0066a58315664b2c61..7a261552202f8653e33f1b3811d64104b92baf9f 100644 (file)
@@ -139,6 +139,6 @@ _mesa_glthread_AttribPointer(struct gl_context *ctx)
 {
    struct glthread_state *glthread = ctx->GLThread;
 
-   if (ctx->API != API_OPENGL_CORE && !glthread->vertex_array_is_vbo)
+   if (!glthread->vertex_array_is_vbo)
       glthread->CurrentVAO->HasUserPointer = true;
 }