i965: Add back gen6 headerless FB writes to the new FS backend.
It's not that hard to detect when we need the header.
This commit is contained in:
parent
3fabd218a0
commit
3c97c00e38
|
@ -324,6 +324,7 @@ public:
|
||||||
this->sampler = 0;
|
this->sampler = 0;
|
||||||
this->target = 0;
|
this->target = 0;
|
||||||
this->eot = false;
|
this->eot = false;
|
||||||
|
this->header_present = false;
|
||||||
this->shadow_compare = false;
|
this->shadow_compare = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -376,6 +377,7 @@ public:
|
||||||
int sampler;
|
int sampler;
|
||||||
int target; /**< MRT target. */
|
int target; /**< MRT target. */
|
||||||
bool eot;
|
bool eot;
|
||||||
|
bool header_present;
|
||||||
bool shadow_compare;
|
bool shadow_compare;
|
||||||
|
|
||||||
/** @{
|
/** @{
|
||||||
|
@ -420,7 +422,10 @@ public:
|
||||||
this->virtual_grf_array_size = 0;
|
this->virtual_grf_array_size = 0;
|
||||||
this->virtual_grf_def = NULL;
|
this->virtual_grf_def = NULL;
|
||||||
this->virtual_grf_use = NULL;
|
this->virtual_grf_use = NULL;
|
||||||
|
|
||||||
|
this->kill_emitted = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
~fs_visitor()
|
~fs_visitor()
|
||||||
{
|
{
|
||||||
talloc_free(this->mem_ctx);
|
talloc_free(this->mem_ctx);
|
||||||
|
@ -503,6 +508,7 @@ public:
|
||||||
ir_variable *frag_color, *frag_data, *frag_depth;
|
ir_variable *frag_color, *frag_data, *frag_depth;
|
||||||
int first_non_payload_grf;
|
int first_non_payload_grf;
|
||||||
int urb_setup[FRAG_ATTRIB_MAX];
|
int urb_setup[FRAG_ATTRIB_MAX];
|
||||||
|
bool kill_emitted;
|
||||||
|
|
||||||
/** @{ debug annotation info */
|
/** @{ debug annotation info */
|
||||||
const char *current_annotation;
|
const char *current_annotation;
|
||||||
|
@ -1509,6 +1515,7 @@ fs_visitor::visit(ir_discard *ir)
|
||||||
assert(ir->condition == NULL); /* FINISHME */
|
assert(ir->condition == NULL); /* FINISHME */
|
||||||
|
|
||||||
emit(fs_inst(FS_OPCODE_DISCARD, temp, temp));
|
emit(fs_inst(FS_OPCODE_DISCARD, temp, temp));
|
||||||
|
kill_emitted = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1843,10 +1850,19 @@ void
|
||||||
fs_visitor::emit_fb_writes()
|
fs_visitor::emit_fb_writes()
|
||||||
{
|
{
|
||||||
this->current_annotation = "FB write header";
|
this->current_annotation = "FB write header";
|
||||||
|
GLboolean header_present = GL_TRUE;
|
||||||
int nr = 0;
|
int nr = 0;
|
||||||
|
|
||||||
/* m0, m1 header */
|
if (intel->gen >= 6 &&
|
||||||
nr += 2;
|
!this->kill_emitted &&
|
||||||
|
c->key.nr_color_regions == 1) {
|
||||||
|
header_present = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (header_present) {
|
||||||
|
/* m0, m1 header */
|
||||||
|
nr += 2;
|
||||||
|
}
|
||||||
|
|
||||||
if (c->key.aa_dest_stencil_reg) {
|
if (c->key.aa_dest_stencil_reg) {
|
||||||
emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, nr++),
|
emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, nr++),
|
||||||
|
@ -1911,6 +1927,7 @@ fs_visitor::emit_fb_writes()
|
||||||
reg_undef, reg_undef));
|
reg_undef, reg_undef));
|
||||||
inst->mlen = nr;
|
inst->mlen = nr;
|
||||||
inst->eot = true;
|
inst->eot = true;
|
||||||
|
inst->header_present = header_present;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->current_annotation = NULL;
|
this->current_annotation = NULL;
|
||||||
|
@ -1929,18 +1946,22 @@ fs_visitor::generate_fb_write(fs_inst *inst)
|
||||||
brw_set_mask_control(p, BRW_MASK_DISABLE);
|
brw_set_mask_control(p, BRW_MASK_DISABLE);
|
||||||
brw_set_compression_control(p, BRW_COMPRESSION_NONE);
|
brw_set_compression_control(p, BRW_COMPRESSION_NONE);
|
||||||
|
|
||||||
if (intel->gen >= 6) {
|
if (inst->header_present) {
|
||||||
brw_MOV(p,
|
if (intel->gen >= 6) {
|
||||||
brw_message_reg(0),
|
brw_MOV(p,
|
||||||
brw_vec8_grf(0, 0));
|
brw_message_reg(0),
|
||||||
implied_header = brw_null_reg();
|
brw_vec8_grf(0, 0));
|
||||||
} else {
|
implied_header = brw_null_reg();
|
||||||
implied_header = retype(brw_vec8_grf(0, 0), BRW_REGISTER_TYPE_UW);
|
} else {
|
||||||
}
|
implied_header = retype(brw_vec8_grf(0, 0), BRW_REGISTER_TYPE_UW);
|
||||||
|
}
|
||||||
|
|
||||||
brw_MOV(p,
|
brw_MOV(p,
|
||||||
brw_message_reg(1),
|
brw_message_reg(1),
|
||||||
brw_vec8_grf(1, 0));
|
brw_vec8_grf(1, 0));
|
||||||
|
} else {
|
||||||
|
implied_header = brw_null_reg();
|
||||||
|
}
|
||||||
|
|
||||||
brw_pop_insn_state(p);
|
brw_pop_insn_state(p);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue