glthread: add support for glClearNamedFramebuffer, glMaterial, glPointParameter
authorMarek Olšák <marek.olsak@amd.com>
Thu, 20 Feb 2020 02:57:58 +0000 (21:57 -0500)
committerMarge Bot <eric+marge@anholt.net>
Fri, 6 Mar 2020 01:06:14 +0000 (01:06 +0000)
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>

src/mapi/glapi/gen/ARB_direct_state_access.xml
src/mapi/glapi/gen/gl_API.xml
src/mapi/glapi/gen/gl_and_es_API.xml
src/mesa/main/marshal.h

index c652a412aa721b334e5f85eafe145d6a15ef4c57..3e39253c2a9bdda0e10fb04bc1a72a0812f06d72 100644 (file)
       <param name="framebuffer" type="GLuint" />
       <param name="buffer" type="GLenum" />
       <param name="drawbuffer" type="GLint" />
-      <param name="value" type="const GLint *" />
+      <param name="value" type="const GLint *" count="_mesa_buffer_enum_to_count(buffer)"/>
    </function>
 
    <function name="ClearNamedFramebufferuiv">
       <param name="framebuffer" type="GLuint" />
       <param name="buffer" type="GLenum" />
       <param name="drawbuffer" type="GLint" />
-      <param name="value" type="const GLuint *" />
+      <param name="value" type="const GLuint *" count="_mesa_buffer_enum_to_count(buffer)"/>
    </function>
 
    <function name="ClearNamedFramebufferfv">
       <param name="framebuffer" type="GLuint" />
       <param name="buffer" type="GLenum" />
       <param name="drawbuffer" type="GLint" />
-      <param name="value" type="const GLfloat *" />
+      <param name="value" type="const GLfloat *" count="_mesa_buffer_enum_to_count(buffer)"/>
    </function>
 
    <function name="ClearNamedFramebufferfi">
index 849a0b28d336a1fd8301cadea31bf47891bd50a1..ff4bd8144d7d9d630aafc561aca24a980b23111b 100644 (file)
     <function name="Materialfv" es1="1.0" deprecated="3.1" exec="dynamic">
         <param name="face" type="GLenum"/>
         <param name="pname" type="GLenum"/>
-        <param name="params" type="const GLfloat *" variable_param="pname"/>
+        <param name="params" type="const GLfloat *" variable_param="pname"
+               marshal_count="_mesa_material_enum_to_count(pname)"/>
         <glx rop="97"/>
     </function>
 
     <function name="Materialiv" deprecated="3.1">
         <param name="face" type="GLenum"/>
         <param name="pname" type="GLenum"/>
-        <param name="params" type="const GLint *" variable_param="pname"/>
+        <param name="params" type="const GLint *" variable_param="pname"
+               marshal_count="_mesa_material_enum_to_count(pname)"/>
         <glx rop="99"/>
     </function>
 
 
     <function name="PointParameterfv" es1="1.1">
         <param name="pname" type="GLenum"/>
-        <param name="params" type="const GLfloat *" variable_param="pname"/>
+        <param name="params" type="const GLfloat *" variable_param="pname"
+               marshal_count="_mesa_point_param_enum_to_count(pname)"/>
         <glx rop="2066"/>
     </function>
 
 
     <function name="PointParameteriv">
         <param name="pname" type="GLenum"/>
-        <param name="params" type="const GLint *" variable_param="pname"/>
+        <param name="params" type="const GLint *" variable_param="pname"
+               marshal_count="_mesa_point_param_enum_to_count(pname)"/>
         <glx rop="4222"/>
     </function>
 
index 7d33d6dcf4ade80dba5b3f7d1650d97d9f4343fe..6fd2c8dec6652b9d21610b5fcd5ab339ab4aab88 100644 (file)
     <function name="Materialxv" es1="1.0" desktop="false">
         <param name="face" type="GLenum"/>
         <param name="pname" type="GLenum"/>
-        <param name="params" type="const GLfixed *" variable_param="pname"/>
+        <param name="params" type="const GLfixed *" variable_param="pname"
+               marshal_count="_mesa_material_enum_to_count(pname)"/>
     </function>
 
     <function name="MultMatrixx" es1="1.0" desktop="false">
 
     <function name="PointParameterxv" es1="1.1" desktop="false">
         <param name="pname" type="GLenum"/>
-        <param name="params" type="const GLfixed *"/>
+        <param name="params" type="const GLfixed *"
+               count="_mesa_point_param_enum_to_count(pname)"/>
     </function>
 
     <function name="TexParameterxv" es1="1.1" desktop="false">
index fc69f2704b8ae1f149e3235622d239a7e41eecdc..a9d9569ad1172b91d0429acb69018cc423db2b1e 100644 (file)
@@ -404,4 +404,40 @@ _mesa_texgen_enum_to_count(GLenum pname)
    }
 }
 
+static inline unsigned
+_mesa_material_enum_to_count(GLenum pname)
+{
+   switch (pname) {
+   case GL_EMISSION:
+   case GL_AMBIENT:
+   case GL_DIFFUSE:
+   case GL_SPECULAR:
+   case GL_AMBIENT_AND_DIFFUSE:
+      return 4;
+   case GL_COLOR_INDEXES:
+      return 3;
+   case GL_SHININESS:
+      return 1;
+   default:
+      return 0;
+   }
+}
+
+static inline unsigned
+_mesa_point_param_enum_to_count(GLenum pname)
+{
+   switch (pname) {
+   case GL_DISTANCE_ATTENUATION_EXT:
+      return 3;
+   case GL_POINT_SIZE_MIN_EXT:
+   case GL_POINT_SIZE_MAX_EXT:
+   case GL_POINT_FADE_THRESHOLD_SIZE_EXT:
+   case GL_POINT_SPRITE_R_MODE_NV:
+   case GL_POINT_SPRITE_COORD_ORIGIN:
+      return 1;
+   default:
+      return 0;
+   }
+}
+
 #endif /* MARSHAL_H */