From: Marek Olšák Date: Thu, 20 Feb 2020 02:44:26 +0000 (-0500) Subject: glthread: add support for glFog, glLight, glLightModel, glTexEnv, glTexGen X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b0a20e753110afaf4336d64928f7a11dc3901a6f;p=mesa.git glthread: add support for glFog, glLight, glLightModel, glTexEnv, glTexGen Reviewed-by: Timothy Arceri Part-of: --- 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 @@ - + @@ -374,7 +374,7 @@ - + @@ -605,7 +605,7 @@ - + @@ -619,7 +619,7 @@ - + @@ -633,7 +633,7 @@ - + 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 @@ - + 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 @@ - + @@ -1986,7 +1987,8 @@ - + @@ -2011,7 +2013,8 @@ - + @@ -2025,7 +2028,8 @@ - + @@ -2037,7 +2041,8 @@ - + @@ -2049,7 +2054,8 @@ - + @@ -2186,7 +2192,8 @@ - + @@ -2200,7 +2207,8 @@ - + @@ -2214,7 +2222,8 @@ - + @@ -2228,7 +2237,8 @@ - + @@ -2242,7 +2252,8 @@ - + 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 @@ - + @@ -72,7 +73,8 @@ - + @@ -84,7 +86,8 @@ - + @@ -170,7 +173,8 @@ - + 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 */