r600g: nuke the fallback for vertex and fragment color clamping
This commit is contained in:
@@ -902,8 +902,6 @@ static void *evergreen_create_rs_state(struct pipe_context *ctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
rstate = &rs->rstate;
|
rstate = &rs->rstate;
|
||||||
rs->clamp_vertex_color = state->clamp_vertex_color;
|
|
||||||
rs->clamp_fragment_color = state->clamp_fragment_color;
|
|
||||||
rs->flatshade = state->flatshade;
|
rs->flatshade = state->flatshade;
|
||||||
rs->sprite_coord_enable = state->sprite_coord_enable;
|
rs->sprite_coord_enable = state->sprite_coord_enable;
|
||||||
rs->two_side = state->light_twoside;
|
rs->two_side = state->light_twoside;
|
||||||
|
@@ -105,8 +105,6 @@ struct r600_pipe_sampler_view {
|
|||||||
|
|
||||||
struct r600_pipe_rasterizer {
|
struct r600_pipe_rasterizer {
|
||||||
struct r600_pipe_state rstate;
|
struct r600_pipe_state rstate;
|
||||||
boolean clamp_vertex_color;
|
|
||||||
boolean clamp_fragment_color;
|
|
||||||
boolean flatshade;
|
boolean flatshade;
|
||||||
boolean two_side;
|
boolean two_side;
|
||||||
unsigned sprite_coord_enable;
|
unsigned sprite_coord_enable;
|
||||||
@@ -217,8 +215,6 @@ struct r600_pipe_context {
|
|||||||
struct pipe_query *saved_render_cond;
|
struct pipe_query *saved_render_cond;
|
||||||
unsigned saved_render_cond_mode;
|
unsigned saved_render_cond_mode;
|
||||||
/* shader information */
|
/* shader information */
|
||||||
boolean clamp_vertex_color;
|
|
||||||
boolean clamp_fragment_color;
|
|
||||||
boolean two_side;
|
boolean two_side;
|
||||||
unsigned user_clip_plane_enable;
|
unsigned user_clip_plane_enable;
|
||||||
unsigned clip_dist_enable;
|
unsigned clip_dist_enable;
|
||||||
|
@@ -835,10 +835,6 @@ static int r600_shader_from_tgsi(struct r600_pipe_context * rctx, struct r600_pi
|
|||||||
ctx.clip_vertex_write = 0;
|
ctx.clip_vertex_write = 0;
|
||||||
|
|
||||||
shader->two_side = (ctx.type == TGSI_PROCESSOR_FRAGMENT) && rctx->two_side;
|
shader->two_side = (ctx.type == TGSI_PROCESSOR_FRAGMENT) && rctx->two_side;
|
||||||
|
|
||||||
shader->clamp_color = (((ctx.type == TGSI_PROCESSOR_FRAGMENT) && rctx->clamp_fragment_color) ||
|
|
||||||
((ctx.type == TGSI_PROCESSOR_VERTEX) && rctx->clamp_vertex_color));
|
|
||||||
|
|
||||||
shader->nr_cbufs = rctx->nr_cbufs;
|
shader->nr_cbufs = rctx->nr_cbufs;
|
||||||
|
|
||||||
/* register allocations */
|
/* register allocations */
|
||||||
@@ -1034,37 +1030,6 @@ static int r600_shader_from_tgsi(struct r600_pipe_context * rctx, struct r600_pi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* clamp color outputs */
|
|
||||||
if (shader->clamp_color) {
|
|
||||||
for (i = 0; i < noutput; i++) {
|
|
||||||
if (shader->output[i].name == TGSI_SEMANTIC_COLOR ||
|
|
||||||
shader->output[i].name == TGSI_SEMANTIC_BCOLOR) {
|
|
||||||
|
|
||||||
int j;
|
|
||||||
for (j = 0; j < 4; j++) {
|
|
||||||
struct r600_bytecode_alu alu;
|
|
||||||
memset(&alu, 0, sizeof(struct r600_bytecode_alu));
|
|
||||||
|
|
||||||
/* MOV_SAT R, R */
|
|
||||||
alu.inst = BC_INST(ctx.bc, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV);
|
|
||||||
alu.dst.sel = shader->output[i].gpr;
|
|
||||||
alu.dst.chan = j;
|
|
||||||
alu.dst.write = 1;
|
|
||||||
alu.dst.clamp = 1;
|
|
||||||
alu.src[0].sel = alu.dst.sel;
|
|
||||||
alu.src[0].chan = j;
|
|
||||||
|
|
||||||
if (j == 3) {
|
|
||||||
alu.last = 1;
|
|
||||||
}
|
|
||||||
r = r600_bytecode_add_alu(ctx.bc, &alu);
|
|
||||||
if (r)
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Add stream outputs. */
|
/* Add stream outputs. */
|
||||||
if (ctx.type == TGSI_PROCESSOR_VERTEX && so.num_outputs) {
|
if (ctx.type == TGSI_PROCESSOR_VERTEX && so.num_outputs) {
|
||||||
for (i = 0; i < so.num_outputs; i++) {
|
for (i = 0; i < so.num_outputs; i++) {
|
||||||
|
@@ -48,7 +48,6 @@ struct r600_shader {
|
|||||||
boolean uses_kill;
|
boolean uses_kill;
|
||||||
boolean fs_write_all;
|
boolean fs_write_all;
|
||||||
boolean vs_prohibit_ucps;
|
boolean vs_prohibit_ucps;
|
||||||
boolean clamp_color;
|
|
||||||
boolean two_side;
|
boolean two_side;
|
||||||
unsigned nr_cbufs;
|
unsigned nr_cbufs;
|
||||||
/* bit n is set if the shader writes gl_ClipDistance[n] */
|
/* bit n is set if the shader writes gl_ClipDistance[n] */
|
||||||
|
@@ -954,8 +954,6 @@ static void *r600_create_rs_state(struct pipe_context *ctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
rstate = &rs->rstate;
|
rstate = &rs->rstate;
|
||||||
rs->clamp_vertex_color = state->clamp_vertex_color;
|
|
||||||
rs->clamp_fragment_color = state->clamp_fragment_color;
|
|
||||||
rs->flatshade = state->flatshade;
|
rs->flatshade = state->flatshade;
|
||||||
rs->sprite_coord_enable = state->sprite_coord_enable;
|
rs->sprite_coord_enable = state->sprite_coord_enable;
|
||||||
rs->two_side = state->light_twoside;
|
rs->two_side = state->light_twoside;
|
||||||
|
@@ -99,9 +99,6 @@ void r600_bind_rs_state(struct pipe_context *ctx, void *state)
|
|||||||
if (state == NULL)
|
if (state == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
rctx->clamp_vertex_color = rs->clamp_vertex_color;
|
|
||||||
rctx->clamp_fragment_color = rs->clamp_fragment_color;
|
|
||||||
|
|
||||||
rctx->sprite_coord_enable = rs->sprite_coord_enable;
|
rctx->sprite_coord_enable = rs->sprite_coord_enable;
|
||||||
rctx->two_side = rs->two_side;
|
rctx->two_side = rs->two_side;
|
||||||
|
|
||||||
@@ -588,12 +585,7 @@ static void r600_update_derived_state(struct r600_pipe_context *rctx)
|
|||||||
r600_update_sampler_states(rctx);
|
r600_update_sampler_states(rctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rctx->vs_shader->shader.clamp_color != rctx->clamp_vertex_color) {
|
if ((rctx->ps_shader->shader.two_side != rctx->two_side) ||
|
||||||
r600_shader_rebuild(&rctx->context, rctx->vs_shader);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((rctx->ps_shader->shader.clamp_color != rctx->clamp_fragment_color) ||
|
|
||||||
(rctx->ps_shader->shader.two_side != rctx->two_side) ||
|
|
||||||
((rctx->chip_class >= EVERGREEN) && rctx->ps_shader->shader.fs_write_all &&
|
((rctx->chip_class >= EVERGREEN) && rctx->ps_shader->shader.fs_write_all &&
|
||||||
(rctx->ps_shader->shader.nr_cbufs != rctx->nr_cbufs))) {
|
(rctx->ps_shader->shader.nr_cbufs != rctx->nr_cbufs))) {
|
||||||
r600_shader_rebuild(&rctx->context, rctx->ps_shader);
|
r600_shader_rebuild(&rctx->context, rctx->ps_shader);
|
||||||
|
Reference in New Issue
Block a user