}
rstate = &rs->rstate;
- rs->clamp_vertex_color = state->clamp_vertex_color;
- rs->clamp_fragment_color = state->clamp_fragment_color;
rs->flatshade = state->flatshade;
rs->sprite_coord_enable = state->sprite_coord_enable;
rs->two_side = state->light_twoside;
struct r600_pipe_rasterizer {
struct r600_pipe_state rstate;
- boolean clamp_vertex_color;
- boolean clamp_fragment_color;
boolean flatshade;
boolean two_side;
unsigned sprite_coord_enable;
struct pipe_query *saved_render_cond;
unsigned saved_render_cond_mode;
/* shader information */
- boolean clamp_vertex_color;
- boolean clamp_fragment_color;
boolean two_side;
unsigned user_clip_plane_enable;
unsigned clip_dist_enable;
ctx.clip_vertex_write = 0;
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;
/* register allocations */
}
}
- /* 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. */
if (ctx.type == TGSI_PROCESSOR_VERTEX && so.num_outputs) {
for (i = 0; i < so.num_outputs; i++) {
boolean uses_kill;
boolean fs_write_all;
boolean vs_prohibit_ucps;
- boolean clamp_color;
boolean two_side;
unsigned nr_cbufs;
/* bit n is set if the shader writes gl_ClipDistance[n] */
}
rstate = &rs->rstate;
- rs->clamp_vertex_color = state->clamp_vertex_color;
- rs->clamp_fragment_color = state->clamp_fragment_color;
rs->flatshade = state->flatshade;
rs->sprite_coord_enable = state->sprite_coord_enable;
rs->two_side = state->light_twoside;
if (state == NULL)
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->two_side = rs->two_side;
r600_update_sampler_states(rctx);
}
- if (rctx->vs_shader->shader.clamp_color != rctx->clamp_vertex_color) {
- 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) ||
+ if ((rctx->ps_shader->shader.two_side != rctx->two_side) ||
((rctx->chip_class >= EVERGREEN) && rctx->ps_shader->shader.fs_write_all &&
(rctx->ps_shader->shader.nr_cbufs != rctx->nr_cbufs))) {
r600_shader_rebuild(&rctx->context, rctx->ps_shader);