i965/fs: Pass fragment depth to the fb write as a fs_reg, not an ir_variable.
This will be used for the ARB_fp change to use this backend. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
@@ -370,7 +370,7 @@ public:
|
|||||||
int *params_remap;
|
int *params_remap;
|
||||||
|
|
||||||
struct hash_table *variable_ht;
|
struct hash_table *variable_ht;
|
||||||
ir_variable *frag_depth;
|
fs_reg frag_depth;
|
||||||
fs_reg outputs[BRW_MAX_DRAW_BUFFERS];
|
fs_reg outputs[BRW_MAX_DRAW_BUFFERS];
|
||||||
unsigned output_components[BRW_MAX_DRAW_BUFFERS];
|
unsigned output_components[BRW_MAX_DRAW_BUFFERS];
|
||||||
fs_reg dual_src_output;
|
fs_reg dual_src_output;
|
||||||
|
@@ -83,7 +83,7 @@ fs_visitor::visit(ir_variable *ir)
|
|||||||
this->output_components[i] = 4;
|
this->output_components[i] = 4;
|
||||||
}
|
}
|
||||||
} else if (ir->location == FRAG_RESULT_DEPTH) {
|
} else if (ir->location == FRAG_RESULT_DEPTH) {
|
||||||
this->frag_depth = ir;
|
this->frag_depth = *reg;
|
||||||
} else {
|
} else {
|
||||||
/* gl_FragData or a user-defined FS output */
|
/* gl_FragData or a user-defined FS output */
|
||||||
assert(ir->location >= FRAG_RESULT_DATA0 &&
|
assert(ir->location >= FRAG_RESULT_DATA0 &&
|
||||||
@@ -2111,10 +2111,8 @@ fs_visitor::emit_fb_writes()
|
|||||||
|
|
||||||
if (c->computes_depth) {
|
if (c->computes_depth) {
|
||||||
/* Hand over gl_FragDepth. */
|
/* Hand over gl_FragDepth. */
|
||||||
assert(this->frag_depth);
|
assert(this->frag_depth.file != BAD_FILE);
|
||||||
fs_reg depth = *(variable_storage(this->frag_depth));
|
emit(BRW_OPCODE_MOV, fs_reg(MRF, nr), this->frag_depth);
|
||||||
|
|
||||||
emit(BRW_OPCODE_MOV, fs_reg(MRF, nr), depth);
|
|
||||||
} else {
|
} else {
|
||||||
/* Pass through the payload depth. */
|
/* Pass through the payload depth. */
|
||||||
emit(BRW_OPCODE_MOV, fs_reg(MRF, nr),
|
emit(BRW_OPCODE_MOV, fs_reg(MRF, nr),
|
||||||
@@ -2275,7 +2273,6 @@ fs_visitor::fs_visitor(struct brw_wm_compile *c, struct gl_shader_program *prog,
|
|||||||
else
|
else
|
||||||
this->reg_null_cmp = reg_null_f;
|
this->reg_null_cmp = reg_null_f;
|
||||||
|
|
||||||
this->frag_depth = NULL;
|
|
||||||
memset(this->outputs, 0, sizeof(this->outputs));
|
memset(this->outputs, 0, sizeof(this->outputs));
|
||||||
memset(this->output_components, 0, sizeof(this->output_components));
|
memset(this->output_components, 0, sizeof(this->output_components));
|
||||||
this->first_non_payload_grf = 0;
|
this->first_non_payload_grf = 0;
|
||||||
|
Reference in New Issue
Block a user