diff options
author | Brian <[email protected]> | 2007-07-12 12:20:14 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2007-07-12 12:20:14 -0600 |
commit | 86352ff70d8c9a31fe0ebb4d02ce4bb4644fe54a (patch) | |
tree | 2dcf373eacfec2e125771e3a5b51116969fefe46 /src/mesa/state_tracker | |
parent | bd5533bb7c90d8da06f6a1c38bdc84bb607c5b85 (diff) |
Added colormask, dither, multisample state. Implement colormasking stage.
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_atom_blend.c | 13 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_setup.c | 5 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_atom_blend.c b/src/mesa/state_tracker/st_atom_blend.c index 3e5410cfab2..256f13471a2 100644 --- a/src/mesa/state_tracker/st_atom_blend.c +++ b/src/mesa/state_tracker/st_atom_blend.c @@ -196,6 +196,19 @@ update_blend( struct st_context *st ) /* no blending / logicop */ } + /* Colormask - maybe reverse these bits? */ + if (st->ctx->Color.ColorMask[0]) + blend.colormask |= PIPE_MASK_R; + if (st->ctx->Color.ColorMask[1]) + blend.colormask |= PIPE_MASK_G; + if (st->ctx->Color.ColorMask[2]) + blend.colormask |= PIPE_MASK_B; + if (st->ctx->Color.ColorMask[3]) + blend.colormask |= PIPE_MASK_A; + + if (st->ctx->Color.DitherFlag) + blend.dither = 1; + if (memcmp(&blend, &st->state.blend, sizeof(blend)) != 0) { /* state has changed */ st->state.blend = blend; /* struct copy */ diff --git a/src/mesa/state_tracker/st_atom_setup.c b/src/mesa/state_tracker/st_atom_setup.c index 842a87c8a1c..8b95ea958eb 100644 --- a/src/mesa/state_tracker/st_atom_setup.c +++ b/src/mesa/state_tracker/st_atom_setup.c @@ -186,6 +186,9 @@ static void update_setup_state( struct st_context *st ) /* GL stipple factor is in [1,256], remap to [0, 255] here */ setup.line_stipple_factor = ctx->Line.StippleFactor - 1; + /* _NEW_MULTISAMPLE */ + if (ctx->Multisample.Enabled) + setup.multisample = 1; if (memcmp(&setup, &st->state.setup, sizeof(setup)) != 0) { st->state.setup = setup; @@ -196,7 +199,7 @@ static void update_setup_state( struct st_context *st ) const struct st_tracked_state st_update_setup = { .dirty = { .mesa = (_NEW_LIGHT | _NEW_POLYGON | _NEW_LINE | - _NEW_POINT | _NEW_BUFFERS), + _NEW_POINT | _NEW_BUFFERS | _NEW_MULTISAMPLE), .st = 0, }, .update = update_setup_state |