Since it's a derived field.
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);
#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)
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);
#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)
(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 <<
/* 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__);
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)
(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 <<
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__);
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++) {
/*
* 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;
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;
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 );
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;
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];
* 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 */
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 );