diff options
author | Marek Olšák <[email protected]> | 2020-02-19 21:44:26 -0500 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-03-06 01:06:14 +0000 |
commit | b0a20e753110afaf4336d64928f7a11dc3901a6f (patch) | |
tree | d969fff1d56176554884a89ad0a611bbce34215e /src/mesa/main | |
parent | 59e96bc513be3938e2d6dc4357e4d38fa5481f6a (diff) |
glthread: add support for glFog, glLight, glLightModel, glTexEnv, glTexGen
Reviewed-by: Timothy Arceri <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/marshal.h | 105 |
1 files changed, 105 insertions, 0 deletions
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 */ |