[Mesa-dev] [PATCH 3/6] i965: Add uses_kill to brw_wm_prog_data
Jordan Justen
jordan.l.justen at intel.com
Fri Sep 5 00:44:14 PDT 2014
Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
src/mesa/drivers/dri/i965/brw_context.h | 1 +
src/mesa/drivers/dri/i965/brw_fs.cpp | 2 +-
src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 2 +-
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 12 ++++++------
src/mesa/drivers/dri/i965/brw_wm.c | 1 +
5 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index 5faa942..3bc1ea5 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -346,6 +346,7 @@ struct brw_wm_prog_data {
bool dual_src_blend;
bool uses_pos_offset;
bool uses_omask;
+ bool uses_kill;
uint32_t prog_offset_16;
/**
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index ab11a79..2a3a976 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -3191,7 +3191,7 @@ fs_visitor::run()
/* We handle discards by keeping track of the still-live pixels in f0.1.
* 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);
discard_init->flag_subreg = 1;
}
diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
index 068f079..d789972 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
@@ -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
* present.
*/
- if ((fp && fp->UsesKill) || key->alpha_test_func) {
+ if (prog_data->uses_kill || key->alpha_test_func) {
struct brw_reg pixel_mask;
if (brw->gen >= 6)
diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index 8426ad3..93cb4de 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -2690,7 +2690,7 @@ fs_visitor::emit_untyped_atomic(unsigned atomic_op, unsigned surf_index,
emit(MOV(brw_uvec_mrf(8, mlen, 0), fs_reg(0u)))
->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)))
->force_writemask_all = true;
} 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)))
->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)))
->force_writemask_all = true;
} else {
@@ -3056,7 +3056,7 @@ fs_visitor::emit_fb_writes()
* thread message and on all dual-source messages."
*/
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 &&
key->nr_color_regions == 1) {
header_present = false;
@@ -3153,7 +3153,7 @@ fs_visitor::emit_fb_writes()
inst->mlen = nr - base_mrf;
inst->eot = true;
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->flag_subreg = 1;
}
@@ -3202,7 +3202,7 @@ fs_visitor::emit_fb_writes()
inst->mlen = nr - base_mrf;
inst->eot = eot;
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->flag_subreg = 1;
}
@@ -3223,7 +3223,7 @@ fs_visitor::emit_fb_writes()
inst->mlen = nr - base_mrf;
inst->eot = true;
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->flag_subreg = 1;
}
diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c
index 6834534..5863573 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -156,6 +156,7 @@ bool do_wm_prog(struct brw_context *brw,
fs = prog->_LinkedShaders[MESA_SHADER_FRAGMENT];
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
* prog_data associated with the compiled program, and which will be freed
--
2.1.0
More information about the mesa-dev
mailing list