Module: Mesa
Branch: master
Commit: 122da9bd2da1734a35f5df570b23b53a895c1ccf
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=122da9bd2da1734a35f5df570b23b53a895c1ccf

Author: Danylo Piliaiev <[email protected]>
Date:   Mon Dec 28 15:53:08 2020 +0200

freedreno/ir3: remap FRAG_RESULT_COLOR to _DATA* for dual-src blending

gl_SecondaryFragColorEXT is mapped to FRAG_RESULT_COLOR and just
have a different io.dual_source_blend_index. We don't need to replicate
the color to other render targets in case of dual source blending, so
we could just remap it to FRAG_RESULT_DATA0 + index.

Fixes piglit test:
 arb_blend_func_extended-fbo-extended-blend-pattern_gles2

Signed-off-by: Danylo Piliaiev <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8245>

---

 src/freedreno/ir3/ir3_compiler_nir.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/freedreno/ir3/ir3_compiler_nir.c 
b/src/freedreno/ir3/ir3_compiler_nir.c
index a05b1d9f6b1..94828934a2d 100644
--- a/src/freedreno/ir3/ir3_compiler_nir.c
+++ b/src/freedreno/ir3/ir3_compiler_nir.c
@@ -3200,7 +3200,11 @@ setup_output(struct ir3_context *ctx, 
nir_intrinsic_instr *intr)
                        so->writes_pos = true;
                        break;
                case FRAG_RESULT_COLOR:
-                       so->color0_mrt = 1;
+                       if (!ctx->s->info.fs.color_is_dual_source) {
+                               so->color0_mrt = 1;
+                       } else {
+                               slot = FRAG_RESULT_DATA0 + 
io.dual_source_blend_index;
+                       }
                        break;
                case FRAG_RESULT_SAMPLE_MASK:
                        so->writes_smask = true;

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to