diff options
-rw-r--r-- | src/mapi/glapi/gen/EXT_direct_state_access.xml | 10 | ||||
-rw-r--r-- | src/mapi/glapi/gen/OES_fixed_point.xml | 3 | ||||
-rw-r--r-- | src/mapi/glapi/gen/gl_API.xml | 33 | ||||
-rw-r--r-- | src/mapi/glapi/gen/gl_and_es_API.xml | 12 | ||||
-rw-r--r-- | src/mesa/main/marshal.h | 105 |
5 files changed, 142 insertions, 21 deletions
diff --git a/src/mapi/glapi/gen/EXT_direct_state_access.xml b/src/mapi/glapi/gen/EXT_direct_state_access.xml index b1cda780361..8e68ec38b99 100644 --- a/src/mapi/glapi/gen/EXT_direct_state_access.xml +++ b/src/mapi/glapi/gen/EXT_direct_state_access.xml @@ -360,7 +360,7 @@ <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"> @@ -374,7 +374,7 @@ <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"> @@ -605,7 +605,7 @@ <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"> @@ -619,7 +619,7 @@ <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"> @@ -633,7 +633,7 @@ <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"> diff --git a/src/mapi/glapi/gen/OES_fixed_point.xml b/src/mapi/glapi/gen/OES_fixed_point.xml index 5b4c48a7824..73293346ca1 100644 --- a/src/mapi/glapi/gen/OES_fixed_point.xml +++ b/src/mapi/glapi/gen/OES_fixed_point.xml @@ -254,7 +254,8 @@ <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> diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml index 151148060b7..849a0b28d33 100644 --- a/src/mapi/glapi/gen/gl_API.xml +++ b/src/mapi/glapi/gen/gl_API.xml @@ -1974,7 +1974,8 @@ <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> @@ -1986,7 +1987,8 @@ <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> @@ -2011,7 +2013,8 @@ <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> @@ -2025,7 +2028,8 @@ <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> @@ -2037,7 +2041,8 @@ <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> @@ -2049,7 +2054,8 @@ <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> @@ -2186,7 +2192,8 @@ <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> @@ -2200,7 +2207,8 @@ <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> @@ -2214,7 +2222,8 @@ <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> @@ -2228,7 +2237,8 @@ <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> @@ -2242,7 +2252,8 @@ <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> diff --git a/src/mapi/glapi/gen/gl_and_es_API.xml b/src/mapi/glapi/gen/gl_and_es_API.xml index 2f47edf6914..7d33d6dcf4a 100644 --- a/src/mapi/glapi/gen/gl_and_es_API.xml +++ b/src/mapi/glapi/gen/gl_and_es_API.xml @@ -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"> @@ -170,7 +173,8 @@ <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"> diff --git a/src/mesa/main/marshal.h b/src/mesa/main/marshal.h index 15551668fc6..fc69f2704b8 100644 --- a/src/mesa/main/marshal.h +++ b/src/mesa/main/marshal.h @@ -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 */ |