glthread: add support for glFog, glLight, glLightModel, glTexEnv, glTexGen
authorMarek Olšák <marek.olsak@amd.com>
Thu, 20 Feb 2020 02:44:26 +0000 (21:44 -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/EXT_direct_state_access.xml
src/mapi/glapi/gen/OES_fixed_point.xml
src/mapi/glapi/gen/gl_API.xml
src/mapi/glapi/gen/gl_and_es_API.xml
src/mesa/main/marshal.h

index b1cda7803619599d523bce4d61d5ad353b51e9a8..8e68ec38b9910c5ececd27fe4d21cee2f6cad155 100644 (file)
       <param name="texunit" type="GLenum" />
       <param name="target" type="GLenum" />
       <param name="pname" type="GLenum" />
-      <param name="param" type="const GLint *" />
+      <param name="param" type="const GLint *" count="_mesa_texenv_enum_to_count(pname)"/>
    </function>
 
    <function name="MultiTexEnvfEXT">
       <param name="texunit" type="GLenum" />
       <param name="target" type="GLenum" />
       <param name="pname" type="GLenum" />
-      <param name="param" type="const GLfloat *" />
+      <param name="param" type="const GLfloat *" count="_mesa_texenv_enum_to_count(pname)"/>
    </function>
 
    <function name="GetMultiTexEnvivEXT">
       <param name="texunit" type="GLenum" />
       <param name="coord" type="GLenum" />
       <param name="pname" type="GLenum" />
-      <param name="param" type="const GLdouble*" />
+      <param name="param" type="const GLdouble*" count="_mesa_texgen_enum_to_count(pname)"/>
    </function>
 
    <function name="MultiTexGenfEXT">
       <param name="texunit" type="GLenum" />
       <param name="coord" type="GLenum" />
       <param name="pname" type="GLenum" />
-      <param name="param" type="const GLfloat *" />
+      <param name="param" type="const GLfloat *" count="_mesa_texgen_enum_to_count(pname)"/>
    </function>
 
    <function name="MultiTexGeniEXT">
       <param name="texunit" type="GLenum" />
       <param name="coord" type="GLenum" />
       <param name="pname" type="GLenum" />
-      <param name="param" type="const GLint *" />
+      <param name="param" type="const GLint *" count="_mesa_texgen_enum_to_count(pname)"/>
    </function>
 
    <function name="GetMultiTexGendvEXT">
index 5b4c48a7824041afd29aad6bb8195830949248fb..73293346ca1e196d1756f07da3f14a6db1137646 100644 (file)
     <function name="TexGenxvOES" es1="1.0" desktop="false">
         <param name="coord" 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_texgen_enum_to_count(pname)"/>
     </function>
 </category>
 
index 151148060b7042484f0023f6b467862458da684a..849a0b28d336a1fd8301cadea31bf47891bd50a1 100644 (file)
 
     <function name="Fogfv" es1="1.0" deprecated="3.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_fog_enum_to_count(pname)"/>
         <glx rop="81"/>
     </function>
 
 
     <function name="Fogiv" deprecated="3.1">
         <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_fog_enum_to_count(pname)"/>
         <glx rop="83"/>
     </function>
 
     <function name="Lightfv" es1="1.0" deprecated="3.1">
         <param name="light" 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_light_enum_to_count(pname)"/>
         <glx rop="87"/>
     </function>
 
     <function name="Lightiv" deprecated="3.1">
         <param name="light" 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_light_enum_to_count(pname)"/>
         <glx rop="89"/>
     </function>
 
 
     <function name="LightModelfv" es1="1.0" deprecated="3.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_light_model_enum_to_count(pname)"/>
         <glx rop="91"/>
     </function>
 
 
     <function name="LightModeliv" deprecated="3.1">
         <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_light_model_enum_to_count(pname)"/>
         <glx rop="93"/>
     </function>
 
     <function name="TexEnvfv" es1="1.0" deprecated="3.1">
         <param name="target" 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_texenv_enum_to_count(pname)"/>
         <glx rop="112"/>
     </function>
 
     <function name="TexEnviv" es1="1.1" deprecated="3.1">
         <param name="target" 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_texenv_enum_to_count(pname)"/>
         <glx rop="114"/>
     </function>
 
     <function name="TexGendv" deprecated="3.1">
         <param name="coord" type="GLenum"/>
         <param name="pname" type="GLenum"/>
-        <param name="params" type="const GLdouble *" variable_param="pname"/>
+        <param name="params" type="const GLdouble *" variable_param="pname"
+               marshal_count="_mesa_texgen_enum_to_count(pname)"/>
         <glx rop="116"/>
     </function>
 
     <function name="TexGenfv" deprecated="3.1">
         <param name="coord" 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_texgen_enum_to_count(pname)"/>
         <glx rop="118"/>
     </function>
 
     <function name="TexGeniv" deprecated="3.1">
         <param name="coord" 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_texgen_enum_to_count(pname)"/>
         <glx rop="120"/>
     </function>
 
index 2f47edf69149fb5b78ded7bfd1e7e0828909f270..7d33d6dcf4ade80dba5b3f7d1650d97d9f4343fe 100644 (file)
@@ -53,7 +53,8 @@
 
     <function name="Fogxv" es1="1.0" desktop="false">
         <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_fog_enum_to_count(pname)"/>
     </function>
 
     <function name="Frustumx" es1="1.0" desktop="false">
@@ -72,7 +73,8 @@
 
     <function name="LightModelxv" es1="1.0" desktop="false">
         <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_light_model_enum_to_count(pname)"/>
     </function>
 
     <function name="Lightx" es1="1.0" desktop="false">
@@ -84,7 +86,8 @@
     <function name="Lightxv" es1="1.0" desktop="false">
         <param name="light" 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_light_enum_to_count(pname)"/>
     </function>
 
     <function name="LineWidthx" es1="1.0" desktop="false">
     <function name="TexEnvxv" es1="1.0" desktop="false">
         <param name="target" 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_texenv_enum_to_count(pname)"/>
     </function>
 
     <function name="TexParameterx" es1="1.0" desktop="false">
index 15551668fc6fbd8ed437615eab765bcbbee83ffd..fc69f2704b8ae1f149e3235622d239a7e41eecdc 100644 (file)
@@ -299,4 +299,109 @@ _mesa_tex_param_enum_to_count(GLenum pname)
    }
 }
 
+static inline unsigned
+_mesa_fog_enum_to_count(GLenum pname)
+{
+   switch (pname) {
+   case GL_FOG_MODE:
+   case GL_FOG_DENSITY:
+   case GL_FOG_START:
+   case GL_FOG_END:
+   case GL_FOG_INDEX:
+   case GL_FOG_COORDINATE_SOURCE_EXT:
+   case GL_FOG_DISTANCE_MODE_NV:
+      return 1;
+   case GL_FOG_COLOR:
+      return 4;
+   default:
+      return 0;
+   }
+}
+
+static inline unsigned
+_mesa_light_enum_to_count(GLenum pname)
+{
+   switch (pname) {
+   case GL_AMBIENT:
+   case GL_DIFFUSE:
+   case GL_SPECULAR:
+   case GL_POSITION:
+      return 4;
+   case GL_SPOT_DIRECTION:
+      return 3;
+   case GL_SPOT_EXPONENT:
+   case GL_SPOT_CUTOFF:
+   case GL_CONSTANT_ATTENUATION:
+   case GL_LINEAR_ATTENUATION:
+   case GL_QUADRATIC_ATTENUATION:
+      return 1;
+   default:
+      return 0;
+   }
+}
+
+static inline unsigned
+_mesa_light_model_enum_to_count(GLenum pname)
+{
+   switch (pname) {
+   case GL_LIGHT_MODEL_AMBIENT:
+      return 4;
+   case GL_LIGHT_MODEL_LOCAL_VIEWER:
+   case GL_LIGHT_MODEL_TWO_SIDE:
+   case GL_LIGHT_MODEL_COLOR_CONTROL:
+      return 1;
+   default:
+      return 0;
+   }
+}
+
+static inline unsigned
+_mesa_texenv_enum_to_count(GLenum pname)
+{
+   switch (pname) {
+   case GL_TEXTURE_ENV_MODE:
+   case GL_COMBINE_RGB:
+   case GL_COMBINE_ALPHA:
+   case GL_SOURCE0_RGB:
+   case GL_SOURCE1_RGB:
+   case GL_SOURCE2_RGB:
+   case GL_SOURCE3_RGB_NV:
+   case GL_SOURCE0_ALPHA:
+   case GL_SOURCE1_ALPHA:
+   case GL_SOURCE2_ALPHA:
+   case GL_SOURCE3_ALPHA_NV:
+   case GL_OPERAND0_RGB:
+   case GL_OPERAND1_RGB:
+   case GL_OPERAND2_RGB:
+   case GL_OPERAND3_RGB_NV:
+   case GL_OPERAND0_ALPHA:
+   case GL_OPERAND1_ALPHA:
+   case GL_OPERAND2_ALPHA:
+   case GL_OPERAND3_ALPHA_NV:
+   case GL_RGB_SCALE:
+   case GL_ALPHA_SCALE:
+   case GL_TEXTURE_LOD_BIAS_EXT:
+   case GL_COORD_REPLACE_NV:
+      return 1;
+   case GL_TEXTURE_ENV_COLOR:
+      return 4;
+   default:
+      return 0;
+   }
+}
+
+static inline unsigned
+_mesa_texgen_enum_to_count(GLenum pname)
+{
+   switch (pname) {
+   case GL_TEXTURE_GEN_MODE:
+      return 1;
+   case GL_OBJECT_PLANE:
+   case GL_EYE_PLANE:
+      return 4;
+   default:
+      return 0;
+   }
+}
+
 #endif /* MARSHAL_H */