From 2abb9e5ac09c76dd56431e9623c71f7146e4ccb6 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Tue, 22 Sep 2020 09:21:53 +0200 Subject: [PATCH] r600/sfn: Acquire the number of FS outputs and the write_all info early Signed-off-by: Gert Wollny Part-of: --- src/gallium/drivers/r600/sfn/sfn_shader_fragment.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/r600/sfn/sfn_shader_fragment.cpp b/src/gallium/drivers/r600/sfn/sfn_shader_fragment.cpp index 6fccf388745..43e78b72c1e 100644 --- a/src/gallium/drivers/r600/sfn/sfn_shader_fragment.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_shader_fragment.cpp @@ -321,13 +321,18 @@ bool FragmentShaderFromNir::do_process_outputs(nir_variable *output) int loc = output->data.location; if (loc == FRAG_RESULT_COLOR && - (m_nir.info.outputs_written & (1ull << loc))) { + (m_nir.info.outputs_written & (1ull << loc)) && + !m_dual_source_blend) { sh_info().fs_write_all = true; } if (output->data.location == FRAG_RESULT_COLOR || (output->data.location >= FRAG_RESULT_DATA0 && output->data.location <= FRAG_RESULT_DATA7)) { + ++m_max_counted_color_exports; + + if (m_max_counted_color_exports > 1) + sh_info().fs_write_all = false; return true; } if (output->data.location == FRAG_RESULT_DEPTH || @@ -766,7 +771,6 @@ bool FragmentShaderFromNir::emit_export_pixel(const nir_variable *out_var, nir_i sh_info().ps_color_export_mask |= mask; emit_export_instruction(m_last_pixel_export); - ++m_max_counted_color_exports; }; } else if (out_var->data.location == FRAG_RESULT_DEPTH || out_var->data.location == FRAG_RESULT_STENCIL ||