From: Marek Olšák Date: Mon, 23 Jan 2012 02:38:39 +0000 (+0100) Subject: r300g: nuke the fallback for fragment color clamping X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7023ed9e622a3a080ccc6a2739ba1ccd8775a345;p=mesa.git r300g: nuke the fallback for fragment color clamping --- diff --git a/src/gallium/drivers/r300/compiler/r3xx_fragprog.c b/src/gallium/drivers/r300/compiler/r3xx_fragprog.c index 3bee2b64d35..8fea4db94ea 100644 --- a/src/gallium/drivers/r300/compiler/r3xx_fragprog.c +++ b/src/gallium/drivers/r300/compiler/r3xx_fragprog.c @@ -78,32 +78,12 @@ static void rc_rewrite_depth_out(struct radeon_compiler *cc, void *user) } } -static int radeon_saturate_output( - struct radeon_compiler * c, - struct rc_instruction * inst, - void* data) -{ - const struct rc_opcode_info *info = rc_get_opcode_info(inst->U.I.Opcode); - - if (!info->HasDstReg || inst->U.I.DstReg.File != RC_FILE_OUTPUT) - return 0; - - inst->U.I.SaturateMode = RC_SATURATE_ZERO_ONE; - return 1; -} - void r3xx_compile_fragment_program(struct r300_fragment_program_compiler* c) { int is_r500 = c->Base.is_r500; int opt = !c->Base.disable_optimizations; - int sat_out = c->state.frag_clamp; /* Lists of instruction transformations. */ - struct radeon_program_transformation saturate_output[] = { - { &radeon_saturate_output, c }, - { 0, 0 } - }; - struct radeon_program_transformation rewrite_tex[] = { { &radeonTransformTEX, c }, { 0, 0 } @@ -137,7 +117,6 @@ void r3xx_compile_fragment_program(struct r300_fragment_program_compiler* c) {"unroll loops", 1, is_r500, rc_unroll_loops, NULL}, {"transform loops", 1, !is_r500, rc_transform_loops, NULL}, {"emulate branches", 1, !is_r500, rc_emulate_branches, NULL}, - {"saturate output writes", 1, sat_out, rc_local_transform, saturate_output}, {"transform TEX", 1, 1, rc_local_transform, rewrite_tex}, {"transform IF", 1, is_r500, rc_local_transform, rewrite_if}, {"native rewrite", 1, is_r500, rc_local_transform, native_rewrite_r500}, diff --git a/src/gallium/drivers/r300/compiler/radeon_code.h b/src/gallium/drivers/r300/compiler/radeon_code.h index 67e6acf8b10..4280d664f0a 100644 --- a/src/gallium/drivers/r300/compiler/radeon_code.h +++ b/src/gallium/drivers/r300/compiler/radeon_code.h @@ -179,8 +179,6 @@ struct r300_fragment_program_external_state { */ unsigned convert_unorm_to_snorm:1; } unit[16]; - - unsigned frag_clamp:1; }; diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index e40b7af45dd..f32504c530a 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -569,8 +569,6 @@ struct r300_context { int sprite_coord_enable; /* Whether two-sided color selection is enabled (AKA light_twoside). */ boolean two_sided_color; - /* Whether fragment color clamping is enabled. */ - boolean frag_clamp; /* Whether fast color clear is enabled. */ boolean cbzb_clear; /* Whether fragment shader needs to be validated. */ diff --git a/src/gallium/drivers/r300/r300_fs.c b/src/gallium/drivers/r300/r300_fs.c index 320f3987e9a..051b29217ad 100644 --- a/src/gallium/drivers/r300/r300_fs.c +++ b/src/gallium/drivers/r300/r300_fs.c @@ -147,11 +147,8 @@ static void get_external_state( struct r300_fragment_program_external_state* state) { struct r300_textures_state *texstate = r300->textures_state.state; - struct r300_rs_state *rs = r300->rs_state.state; unsigned i; - state->frag_clamp = rs ? rs->rs.clamp_fragment_color : 0; - for (i = 0; i < texstate->sampler_state_count; i++) { struct r300_sampler_state *s = texstate->sampler_states[i]; struct r300_sampler_view *v = texstate->sampler_views[i]; diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 5d4a895e87c..33fdf3b6261 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -1231,7 +1231,6 @@ 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); @@ -1241,12 +1240,10 @@ 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); @@ -1256,11 +1253,6 @@ 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_status == FRAGMENT_SHADER_VALID) { - r300->fs_status = FRAGMENT_SHADER_MAYBE_DIRTY; - } } /* Free rasterizer state. */