diff options
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.cpp | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_wm.c | 5 |
3 files changed, 6 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 68305eff3dc..028eff23efa 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -3620,7 +3620,7 @@ fs_visitor::run() bool alpha_test_func = (stage == MESA_SHADER_FRAGMENT) && ((brw_wm_prog_key*) this->key)->alpha_test_func; - if (uses_kill || alpha_test_func) { + if (uses_kill) { 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 16aa268946c..8d3f0932ed0 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp @@ -179,7 +179,7 @@ fs_generator::generate_fb_write(fs_inst *inst, struct brw_reg payload) /* On HSW, the GPU will use the predicate on SENDC, unless the header is * present. */ - if (prog_data->uses_kill || key->alpha_test_func) { + if (prog_data->uses_kill) { struct brw_reg pixel_mask; if (brw->gen >= 6) diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index 58635736e36..34500e21eeb 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -156,7 +156,10 @@ 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; + /* key->alpha_test_func means simulating alpha testing via discards, + * so the shader definitely kills pixels. + */ + prog_data.uses_kill = fp->program.UsesKill || key->alpha_test_func; /* Allocate the references to the uniforms that will end up in the * prog_data associated with the compiled program, and which will be freed |