i965: Add uses_kill to brw_wm_prog_data
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
d0e166752a
commit
936ca6f3cf
|
@ -346,6 +346,7 @@ struct brw_wm_prog_data {
|
||||||
bool dual_src_blend;
|
bool dual_src_blend;
|
||||||
bool uses_pos_offset;
|
bool uses_pos_offset;
|
||||||
bool uses_omask;
|
bool uses_omask;
|
||||||
|
bool uses_kill;
|
||||||
uint32_t prog_offset_16;
|
uint32_t prog_offset_16;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -3195,7 +3195,7 @@ fs_visitor::run()
|
||||||
/* We handle discards by keeping track of the still-live pixels in f0.1.
|
/* We handle discards by keeping track of the still-live pixels in f0.1.
|
||||||
* Initialize it with the dispatched pixels.
|
* Initialize it with the dispatched pixels.
|
||||||
*/
|
*/
|
||||||
if (fp->UsesKill || key->alpha_test_func) {
|
if (prog_data->uses_kill || key->alpha_test_func) {
|
||||||
fs_inst *discard_init = emit(FS_OPCODE_MOV_DISPATCH_TO_FLAGS);
|
fs_inst *discard_init = emit(FS_OPCODE_MOV_DISPATCH_TO_FLAGS);
|
||||||
discard_init->flag_subreg = 1;
|
discard_init->flag_subreg = 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,7 +160,7 @@ fs_generator::generate_fb_write(fs_inst *inst)
|
||||||
/* On HSW, the GPU will use the predicate on SENDC, unless the header is
|
/* On HSW, the GPU will use the predicate on SENDC, unless the header is
|
||||||
* present.
|
* present.
|
||||||
*/
|
*/
|
||||||
if ((fp && fp->UsesKill) || key->alpha_test_func) {
|
if (prog_data->uses_kill || key->alpha_test_func) {
|
||||||
struct brw_reg pixel_mask;
|
struct brw_reg pixel_mask;
|
||||||
|
|
||||||
if (brw->gen >= 6)
|
if (brw->gen >= 6)
|
||||||
|
|
|
@ -2691,7 +2691,7 @@ fs_visitor::emit_untyped_atomic(unsigned atomic_op, unsigned surf_index,
|
||||||
emit(MOV(brw_uvec_mrf(8, mlen, 0), fs_reg(0u)))
|
emit(MOV(brw_uvec_mrf(8, mlen, 0), fs_reg(0u)))
|
||||||
->force_writemask_all = true;
|
->force_writemask_all = true;
|
||||||
|
|
||||||
if (fp->UsesKill) {
|
if (prog_data->uses_kill) {
|
||||||
emit(MOV(brw_uvec_mrf(1, mlen, 7), brw_flag_reg(0, 1)))
|
emit(MOV(brw_uvec_mrf(1, mlen, 7), brw_flag_reg(0, 1)))
|
||||||
->force_writemask_all = true;
|
->force_writemask_all = true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -2736,7 +2736,7 @@ fs_visitor::emit_untyped_surface_read(unsigned surf_index, fs_reg dst,
|
||||||
emit(MOV(brw_uvec_mrf(8, mlen, 0), fs_reg(0u)))
|
emit(MOV(brw_uvec_mrf(8, mlen, 0), fs_reg(0u)))
|
||||||
->force_writemask_all = true;
|
->force_writemask_all = true;
|
||||||
|
|
||||||
if (fp->UsesKill) {
|
if (prog_data->uses_kill) {
|
||||||
emit(MOV(brw_uvec_mrf(1, mlen, 7), brw_flag_reg(0, 1)))
|
emit(MOV(brw_uvec_mrf(1, mlen, 7), brw_flag_reg(0, 1)))
|
||||||
->force_writemask_all = true;
|
->force_writemask_all = true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -3054,7 +3054,7 @@ fs_visitor::emit_fb_writes()
|
||||||
* thread message and on all dual-source messages."
|
* thread message and on all dual-source messages."
|
||||||
*/
|
*/
|
||||||
if (brw->gen >= 6 &&
|
if (brw->gen >= 6 &&
|
||||||
(brw->is_haswell || brw->gen >= 8 || !this->fp->UsesKill) &&
|
(brw->is_haswell || brw->gen >= 8 || !this->prog_data->uses_kill) &&
|
||||||
!do_dual_src &&
|
!do_dual_src &&
|
||||||
key->nr_color_regions == 1) {
|
key->nr_color_regions == 1) {
|
||||||
header_present = false;
|
header_present = false;
|
||||||
|
@ -3151,7 +3151,7 @@ fs_visitor::emit_fb_writes()
|
||||||
inst->mlen = nr - base_mrf;
|
inst->mlen = nr - base_mrf;
|
||||||
inst->eot = true;
|
inst->eot = true;
|
||||||
inst->header_present = header_present;
|
inst->header_present = header_present;
|
||||||
if ((brw->gen >= 8 || brw->is_haswell) && fp->UsesKill) {
|
if ((brw->gen >= 8 || brw->is_haswell) && prog_data->uses_kill) {
|
||||||
inst->predicate = BRW_PREDICATE_NORMAL;
|
inst->predicate = BRW_PREDICATE_NORMAL;
|
||||||
inst->flag_subreg = 1;
|
inst->flag_subreg = 1;
|
||||||
}
|
}
|
||||||
|
@ -3200,7 +3200,7 @@ fs_visitor::emit_fb_writes()
|
||||||
inst->mlen = nr - base_mrf;
|
inst->mlen = nr - base_mrf;
|
||||||
inst->eot = eot;
|
inst->eot = eot;
|
||||||
inst->header_present = header_present;
|
inst->header_present = header_present;
|
||||||
if ((brw->gen >= 8 || brw->is_haswell) && fp->UsesKill) {
|
if ((brw->gen >= 8 || brw->is_haswell) && prog_data->uses_kill) {
|
||||||
inst->predicate = BRW_PREDICATE_NORMAL;
|
inst->predicate = BRW_PREDICATE_NORMAL;
|
||||||
inst->flag_subreg = 1;
|
inst->flag_subreg = 1;
|
||||||
}
|
}
|
||||||
|
@ -3221,7 +3221,7 @@ fs_visitor::emit_fb_writes()
|
||||||
inst->mlen = nr - base_mrf;
|
inst->mlen = nr - base_mrf;
|
||||||
inst->eot = true;
|
inst->eot = true;
|
||||||
inst->header_present = header_present;
|
inst->header_present = header_present;
|
||||||
if ((brw->gen >= 8 || brw->is_haswell) && fp->UsesKill) {
|
if ((brw->gen >= 8 || brw->is_haswell) && prog_data->uses_kill) {
|
||||||
inst->predicate = BRW_PREDICATE_NORMAL;
|
inst->predicate = BRW_PREDICATE_NORMAL;
|
||||||
inst->flag_subreg = 1;
|
inst->flag_subreg = 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -156,6 +156,7 @@ bool do_wm_prog(struct brw_context *brw,
|
||||||
fs = prog->_LinkedShaders[MESA_SHADER_FRAGMENT];
|
fs = prog->_LinkedShaders[MESA_SHADER_FRAGMENT];
|
||||||
|
|
||||||
memset(&prog_data, 0, sizeof(prog_data));
|
memset(&prog_data, 0, sizeof(prog_data));
|
||||||
|
prog_data.uses_kill = fp->program.UsesKill;
|
||||||
|
|
||||||
/* Allocate the references to the uniforms that will end up in the
|
/* Allocate the references to the uniforms that will end up in the
|
||||||
* prog_data associated with the compiled program, and which will be freed
|
* prog_data associated with the compiled program, and which will be freed
|
||||||
|
|
Loading…
Reference in New Issue