r600: Add flag for dual-source blending to shader key
authorGert Wollny <gert.wollny@collabora.com>
Tue, 22 Sep 2020 07:13:57 +0000 (09:13 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 22 Sep 2020 14:32:45 +0000 (14:32 +0000)
Otherwise the number of outputs and the output data index can't be
interpreted correctly.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6814>

src/gallium/drivers/r600/r600_shader.h
src/gallium/drivers/r600/r600_state_common.c

index 4e4942c..8acd9a3 100644 (file)
@@ -137,6 +137,7 @@ union r600_shader_key {
                unsigned        color_two_side:1;
                unsigned        alpha_to_one:1;
                unsigned        apply_sample_id_mask:1;
+               unsigned        dual_source_blend:1;
        } ps;
        struct {
                unsigned        prim_id_out:8;
index b036bf5..eae6ca1 100644 (file)
@@ -821,8 +821,10 @@ static inline void r600_shader_selector_key(const struct pipe_context *ctx,
                key->ps.nr_cbufs = rctx->framebuffer.state.nr_cbufs;
                 key->ps.apply_sample_id_mask = (rctx->ps_iter_samples > 1) || !rctx->rasterizer->multisample_enable;
                /* Dual-source blending only makes sense with nr_cbufs == 1. */
-               if (key->ps.nr_cbufs == 1 && rctx->dual_src_blend)
+               if (key->ps.nr_cbufs == 1 && rctx->dual_src_blend) {
                        key->ps.nr_cbufs = 2;
+                       key->ps.dual_source_blend = 1;
+               }
                break;
        }
        case PIPE_SHADER_TESS_EVAL: