mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
mesa: rename ColorMaterialBitmask to _ColorMaterialBitmask
Since it's a derived field.
This commit is contained in:
parent
b114ff3783
commit
4cb3579e52
10 changed files with 21 additions and 21 deletions
|
|
@ -57,7 +57,7 @@ void
|
|||
nv10_emit_color_material(struct gl_context *ctx, int emit)
|
||||
{
|
||||
struct nouveau_pushbuf *push = context_push(ctx);
|
||||
unsigned mask = get_material_bitmask(ctx->Light.ColorMaterialBitmask);
|
||||
unsigned mask = get_material_bitmask(ctx->Light._ColorMaterialBitmask);
|
||||
|
||||
BEGIN_NV04(push, NV10_3D(COLOR_MATERIAL), 1);
|
||||
PUSH_DATA (push, ctx->Light.ColorMaterialEnabled ? mask : 0);
|
||||
|
|
@ -313,7 +313,7 @@ nv10_emit_light_source(struct gl_context *ctx, int emit)
|
|||
|
||||
#define USE_COLOR_MATERIAL(attr) \
|
||||
(ctx->Light.ColorMaterialEnabled && \
|
||||
ctx->Light.ColorMaterialBitmask & (1 << MAT_ATTRIB_FRONT_##attr))
|
||||
ctx->Light._ColorMaterialBitmask & (1 << MAT_ATTRIB_FRONT_##attr))
|
||||
|
||||
void
|
||||
nv10_emit_material_ambient(struct gl_context *ctx, int emit)
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ void
|
|||
nv20_emit_color_material(struct gl_context *ctx, int emit)
|
||||
{
|
||||
struct nouveau_pushbuf *push = context_push(ctx);
|
||||
unsigned mask = get_material_bitmask(ctx->Light.ColorMaterialBitmask);
|
||||
unsigned mask = get_material_bitmask(ctx->Light._ColorMaterialBitmask);
|
||||
|
||||
BEGIN_NV04(push, NV20_3D(COLOR_MATERIAL), 1);
|
||||
PUSH_DATA (push, ctx->Light.ColorMaterialEnabled ? mask : 0);
|
||||
|
|
@ -229,7 +229,7 @@ nv20_emit_light_source(struct gl_context *ctx, int emit)
|
|||
|
||||
#define USE_COLOR_MATERIAL(attr, side) \
|
||||
(ctx->Light.ColorMaterialEnabled && \
|
||||
ctx->Light.ColorMaterialBitmask & (1 << MAT_ATTRIB_##attr(side)))
|
||||
ctx->Light._ColorMaterialBitmask & (1 << MAT_ATTRIB_##attr(side)))
|
||||
|
||||
void
|
||||
nv20_emit_material_ambient(struct gl_context *ctx, int emit)
|
||||
|
|
|
|||
|
|
@ -897,7 +897,7 @@ static void r200ColorMaterial( struct gl_context *ctx, GLenum face, GLenum mode
|
|||
(0xf << R200_BACK_SPECULAR_SOURCE_SHIFT));
|
||||
|
||||
if (ctx->Light.ColorMaterialEnabled) {
|
||||
GLuint mask = ctx->Light.ColorMaterialBitmask;
|
||||
GLuint mask = ctx->Light._ColorMaterialBitmask;
|
||||
|
||||
if (mask & MAT_BIT_FRONT_EMISSION) {
|
||||
light_model_ctl1 |= (R200_LM1_SOURCE_VERTEX_COLOR_0 <<
|
||||
|
|
@ -995,7 +995,7 @@ void r200UpdateMaterial( struct gl_context *ctx )
|
|||
|
||||
/* Might be possible and faster to update everything unconditionally? */
|
||||
if (ctx->Light.ColorMaterialEnabled)
|
||||
mask &= ~ctx->Light.ColorMaterialBitmask;
|
||||
mask &= ~ctx->Light._ColorMaterialBitmask;
|
||||
|
||||
if (R200_DEBUG & RADEON_STATE)
|
||||
fprintf(stderr, "%s\n", __FUNCTION__);
|
||||
|
|
|
|||
|
|
@ -707,8 +707,8 @@ static void check_twoside_fallback( struct gl_context *ctx )
|
|||
|
||||
if (ctx->Light.Enabled && ctx->Light.Model.TwoSide) {
|
||||
if (ctx->Light.ColorMaterialEnabled &&
|
||||
(ctx->Light.ColorMaterialBitmask & BACK_MATERIAL_BITS) !=
|
||||
((ctx->Light.ColorMaterialBitmask & FRONT_MATERIAL_BITS)<<1))
|
||||
(ctx->Light._ColorMaterialBitmask & BACK_MATERIAL_BITS) !=
|
||||
((ctx->Light._ColorMaterialBitmask & FRONT_MATERIAL_BITS)<<1))
|
||||
fallback = GL_TRUE;
|
||||
else {
|
||||
for (i = MAT_ATTRIB_FRONT_AMBIENT; i < MAT_ATTRIB_FRONT_INDEXES; i+=2)
|
||||
|
|
@ -736,7 +736,7 @@ static void radeonColorMaterial( struct gl_context *ctx, GLenum face, GLenum mod
|
|||
(3 << RADEON_SPECULAR_SOURCE_SHIFT));
|
||||
|
||||
if (ctx->Light.ColorMaterialEnabled) {
|
||||
GLuint mask = ctx->Light.ColorMaterialBitmask;
|
||||
GLuint mask = ctx->Light._ColorMaterialBitmask;
|
||||
|
||||
if (mask & MAT_BIT_FRONT_EMISSION) {
|
||||
light_model_ctl1 |= (RADEON_LM_SOURCE_VERTEX_DIFFUSE <<
|
||||
|
|
@ -797,7 +797,7 @@ void radeonUpdateMaterial( struct gl_context *ctx )
|
|||
GLuint mask = ~0;
|
||||
|
||||
if (ctx->Light.ColorMaterialEnabled)
|
||||
mask &= ~ctx->Light.ColorMaterialBitmask;
|
||||
mask &= ~ctx->Light._ColorMaterialBitmask;
|
||||
|
||||
if (RADEON_DEBUG & RADEON_STATE)
|
||||
fprintf(stderr, "%s\n", __FUNCTION__);
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ static void make_state_key( struct gl_context *ctx, struct state_key *key )
|
|||
key->light_twoside = 1;
|
||||
|
||||
if (ctx->Light.ColorMaterialEnabled) {
|
||||
key->light_color_material_mask = ctx->Light.ColorMaterialBitmask;
|
||||
key->light_color_material_mask = ctx->Light._ColorMaterialBitmask;
|
||||
}
|
||||
|
||||
for (i = 0; i < MAX_LIGHTS; i++) {
|
||||
|
|
|
|||
|
|
@ -693,13 +693,13 @@ _mesa_update_material( struct gl_context *ctx, GLuint bitmask )
|
|||
|
||||
/*
|
||||
* Update the current materials from the given rgba color
|
||||
* according to the bitmask in ColorMaterialBitmask, which is
|
||||
* according to the bitmask in _ColorMaterialBitmask, which is
|
||||
* set by glColorMaterial().
|
||||
*/
|
||||
void
|
||||
_mesa_update_color_material( struct gl_context *ctx, const GLfloat color[4] )
|
||||
{
|
||||
GLuint bitmask = ctx->Light.ColorMaterialBitmask;
|
||||
const GLbitfield bitmask = ctx->Light._ColorMaterialBitmask;
|
||||
struct gl_material *mat = &ctx->Light.Material;
|
||||
int i;
|
||||
|
||||
|
|
@ -731,13 +731,13 @@ _mesa_ColorMaterial( GLenum face, GLenum mode )
|
|||
if (bitmask == 0)
|
||||
return; /* error was recorded */
|
||||
|
||||
if (ctx->Light.ColorMaterialBitmask == bitmask &&
|
||||
if (ctx->Light._ColorMaterialBitmask == bitmask &&
|
||||
ctx->Light.ColorMaterialFace == face &&
|
||||
ctx->Light.ColorMaterialMode == mode)
|
||||
return;
|
||||
|
||||
FLUSH_VERTICES(ctx, _NEW_LIGHT);
|
||||
ctx->Light.ColorMaterialBitmask = bitmask;
|
||||
ctx->Light._ColorMaterialBitmask = bitmask;
|
||||
ctx->Light.ColorMaterialFace = face;
|
||||
ctx->Light.ColorMaterialMode = mode;
|
||||
|
||||
|
|
@ -1188,7 +1188,7 @@ _mesa_init_lighting( struct gl_context *ctx )
|
|||
ctx->Light.Enabled = GL_FALSE;
|
||||
ctx->Light.ColorMaterialFace = GL_FRONT_AND_BACK;
|
||||
ctx->Light.ColorMaterialMode = GL_AMBIENT_AND_DIFFUSE;
|
||||
ctx->Light.ColorMaterialBitmask = _mesa_material_bitmask( ctx,
|
||||
ctx->Light._ColorMaterialBitmask = _mesa_material_bitmask( ctx,
|
||||
GL_FRONT_AND_BACK,
|
||||
GL_AMBIENT_AND_DIFFUSE, ~0,
|
||||
NULL );
|
||||
|
|
|
|||
|
|
@ -943,7 +943,7 @@ struct gl_light_attrib
|
|||
GLenum ProvokingVertex; /**< GL_EXT_provoking_vertex */
|
||||
GLenum ColorMaterialFace; /**< GL_FRONT, BACK or FRONT_AND_BACK */
|
||||
GLenum ColorMaterialMode; /**< GL_AMBIENT, GL_DIFFUSE, etc */
|
||||
GLbitfield ColorMaterialBitmask; /**< bitmask formed from Face and Mode */
|
||||
GLbitfield _ColorMaterialBitmask; /**< bitmask formed from Face and Mode */
|
||||
GLboolean ColorMaterialEnabled;
|
||||
GLenum ClampVertexColor; /**< GL_TRUE, GL_FALSE, GL_FIXED_ONLY */
|
||||
GLboolean _ClampVertexColor;
|
||||
|
|
|
|||
|
|
@ -227,12 +227,12 @@ prepare_materials(struct gl_context *ctx,
|
|||
store->mat_count = 0;
|
||||
store->mat_bitmask = 0;
|
||||
|
||||
/* Examine the ColorMaterialBitmask to determine which materials
|
||||
/* Examine the _ColorMaterialBitmask to determine which materials
|
||||
* track vertex color. Override the material attribute's pointer
|
||||
* with the color pointer for each one.
|
||||
*/
|
||||
if (ctx->Light.ColorMaterialEnabled) {
|
||||
const GLuint bitmask = ctx->Light.ColorMaterialBitmask;
|
||||
const GLuint bitmask = ctx->Light._ColorMaterialBitmask;
|
||||
for (i = 0 ; i < MAT_ATTRIB_MAX ; i++)
|
||||
if (bitmask & (1<<i))
|
||||
VB->AttribPtr[_TNL_ATTRIB_MAT_FRONT_AMBIENT + i] = VB->AttribPtr[_TNL_ATTRIB_COLOR0];
|
||||
|
|
|
|||
|
|
@ -450,7 +450,7 @@ vbo_Materialfv(GLenum face, GLenum pname, const GLfloat *params)
|
|||
* indicating which material attributes can actually be updated below.
|
||||
*/
|
||||
if (ctx->Light.ColorMaterialEnabled) {
|
||||
updateMats = ~ctx->Light.ColorMaterialBitmask;
|
||||
updateMats = ~ctx->Light._ColorMaterialBitmask;
|
||||
}
|
||||
else {
|
||||
/* GL_COLOR_MATERIAL is disabled so don't skip any material updates */
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ int main( int argc, char **argv )
|
|||
OFFSET( "CTX_LIGHT_SHADE_MODEL ", struct gl_context, Light.ShadeModel );
|
||||
OFFSET( "CTX_LIGHT_COLOR_MAT_FACE ", struct gl_context, Light.ColorMaterialFace );
|
||||
OFFSET( "CTX_LIGHT_COLOR_MAT_MODE ", struct gl_context, Light.ColorMaterialMode );
|
||||
OFFSET( "CTX_LIGHT_COLOR_MAT_MASK ", struct gl_context, Light.ColorMaterialBitmask );
|
||||
OFFSET( "CTX_LIGHT_COLOR_MAT_MASK ", struct gl_context, Light._ColorMaterialBitmask );
|
||||
OFFSET( "CTX_LIGHT_COLOR_MAT_ENABLED ", struct gl_context, Light.ColorMaterialEnabled );
|
||||
OFFSET( "CTX_LIGHT_ENABLED_LIST ", struct gl_context, Light.EnabledList );
|
||||
OFFSET( "CTX_LIGHT_NEED_VERTS ", struct gl_context, Light._NeedVertices );
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue