summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_state.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2011-02-16 00:50:25 +0100
committerMarek Olšák <maraeo@gmail.com>2011-03-29 12:50:28 +0200
commitf03791467090db49e5c3d6111cd8d2a7cbe31d75 (patch)
tree916b9405dfaaca329f633c60262bd591aabc3c93 /src/gallium/drivers/r300/r300_state.c
parent8d4ec87d7f987b3852dafa6802815bb9a3ec7ad4 (diff)
downloadexternal_mesa3d-f03791467090db49e5c3d6111cd8d2a7cbe31d75.zip
external_mesa3d-f03791467090db49e5c3d6111cd8d2a7cbe31d75.tar.gz
external_mesa3d-f03791467090db49e5c3d6111cd8d2a7cbe31d75.tar.bz2
r300g: enable clamping controls
Diffstat (limited to 'src/gallium/drivers/r300/r300_state.c')
-rw-r--r--src/gallium/drivers/r300/r300_state.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index ecb4fc6..890e396 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -398,10 +398,6 @@ static void r300_bind_blend_state(struct pipe_context* pipe,
struct r300_context* r300 = r300_context(pipe);
UPDATE_STATE(state, r300->blend_state);
-
- if (r300->fs.state && r300_pick_fragment_shader(r300)) {
- r300_mark_fs_code_dirty(r300);
- }
}
/* Free blend state. */
@@ -1047,7 +1043,7 @@ static void* r300_create_rs_state(struct pipe_context* pipe,
float point_texcoord_bottom = 0;/* R300_GA_POINT_T0: 0x4204 */
float point_texcoord_right = 1; /* R300_GA_POINT_S1: 0x4208 */
float point_texcoord_top = 0; /* R300_GA_POINT_T1: 0x420c */
- boolean vclamp = TRUE;
+ boolean vclamp = state->clamp_vertex_color;
CB_LOCALS;
/* Copy rasterizer state. */
@@ -1233,6 +1229,7 @@ static void r300_bind_rs_state(struct pipe_context* pipe, void* state)
struct r300_rs_state* rs = (struct r300_rs_state*)state;
int last_sprite_coord_enable = r300->sprite_coord_enable;
boolean last_two_sided_color = r300->two_sided_color;
+ boolean last_frag_clamp = r300->frag_clamp;
if (r300->draw && rs) {
draw_set_rasterizer_state(r300->draw, &rs->rs_draw, state);
@@ -1242,10 +1239,12 @@ static void r300_bind_rs_state(struct pipe_context* pipe, void* state)
r300->polygon_offset_enabled = rs->polygon_offset_enable;
r300->sprite_coord_enable = rs->rs.sprite_coord_enable;
r300->two_sided_color = rs->rs.light_twoside;
+ r300->frag_clamp = rs->rs.clamp_fragment_color;
} else {
r300->polygon_offset_enabled = FALSE;
r300->sprite_coord_enable = 0;
r300->two_sided_color = FALSE;
+ r300->frag_clamp = FALSE;
}
UPDATE_STATE(state, r300->rs_state);
@@ -1255,6 +1254,11 @@ static void r300_bind_rs_state(struct pipe_context* pipe, void* state)
last_two_sided_color != r300->two_sided_color) {
r300_mark_atom_dirty(r300, &r300->rs_block_state);
}
+
+ if (last_frag_clamp != r300->frag_clamp &&
+ r300->fs.state && r300_pick_fragment_shader(r300)) {
+ r300_mark_fs_code_dirty(r300);
+ }
}
/* Free rasterizer state. */