i965/fs: Treat the FB_WRITE as predicated if we're discarding.
authorMatt Turner <mattst88@gmail.com>
Wed, 12 Nov 2014 02:02:23 +0000 (18:02 -0800)
committerMatt Turner <mattst88@gmail.com>
Tue, 2 Dec 2014 00:42:13 +0000 (16:42 -0800)
Pre-Haswell hardware couldn't actually predicate it, but it's easier to
pretend as if it's predicated in the visitor since it will generate a
MOV from f0.1.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs_generator.cpp
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp

index 8d3f0932ed077fbf88f07cea10cc9f9de4b4b6fd..bbed4cc444ed7ddc6396c745d8c46fecdf68ef6e 100644 (file)
@@ -163,6 +163,10 @@ fs_generator::generate_fb_write(fs_inst *inst, struct brw_reg payload)
    const brw_wm_prog_key * const key = (brw_wm_prog_key * const) this->key;
    struct brw_reg implied_header;
 
+   if (brw->gen < 8 && !brw->is_haswell) {
+      brw_set_default_predicate_control(p, BRW_PREDICATE_NONE);
+   }
+
    if (inst->base_mrf >= 0)
       payload = brw_message_reg(inst->base_mrf);
 
index 0b62496b81bc7b6e890889d1b1a1219e56cbb4c3..cc12e482be9a7f29437201da2e477c36921b03d2 100644 (file)
@@ -3334,7 +3334,7 @@ fs_visitor::emit_single_fb_write(fs_reg color0, fs_reg color1,
 
    write->mlen = load->regs_written;
    write->header_present = header_present;
-   if ((brw->gen >= 8 || brw->is_haswell) && prog_data->uses_kill) {
+   if (prog_data->uses_kill) {
       write->predicate = BRW_PREDICATE_NORMAL;
       write->flag_subreg = 1;
    }