intel/fs: Don't enable dual source blend if no outputs are written
authorFrancisco Jerez <currojerez@riseup.net>
Fri, 6 Jan 2017 22:41:27 +0000 (14:41 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 28 Jun 2018 20:19:38 +0000 (13:19 -0700)
This prevents a crash in some arb_enhanced_layouts tests that would be
caused by the next commit.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/intel/compiler/brw_fs_visitor.cpp

index d3d691357116562b8f1316c546421f133ab237c2..746cbb742133cd163a33e8a95908ac299a5804b0 100644 (file)
@@ -440,7 +440,8 @@ fs_visitor::emit_fb_writes()
       inst->target = target;
    }
 
-   prog_data->dual_src_blend = (this->dual_src_output.file != BAD_FILE);
+   prog_data->dual_src_blend = (this->dual_src_output.file != BAD_FILE &&
+                                this->outputs[0].file != BAD_FILE);
    assert(!prog_data->dual_src_blend || key->nr_color_regions == 1);
 
    if (inst == NULL) {