st/nine: Set correctly blend max_rt
authorAxel Davy <davyaxel0@gmail.com>
Mon, 4 May 2020 20:40:08 +0000 (22:40 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 5 May 2020 16:45:06 +0000 (16:45 +0000)
Currently nine_convert_blend_state has no way
of knowing the number of rts.
For now set to an upper bound.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4891>

src/gallium/state_trackers/nine/nine_pipe.c

index 7531845efd6aff158adc2496d7d78718ea93397b..cc63a9fce8f3c8bfedf64b2d5891d45f10a84559 100644 (file)
@@ -186,7 +186,7 @@ nine_convert_blend_state(struct pipe_blend_state *blend_state, const DWORD *rs)
         nine_convert_blend_state_fixup(&blend, rs); /* for BOTH[INV]SRCALPHA */
     }
 
-    blend.max_rt = 0;
+    blend.max_rt = 3; /* Upper bound. Could be optimized to fb->nr_cbufs for example */
     blend.rt[0].colormask = rs[D3DRS_COLORWRITEENABLE];
 
     if (rs[D3DRS_COLORWRITEENABLE1] != rs[D3DRS_COLORWRITEENABLE] ||
@@ -199,7 +199,6 @@ nine_convert_blend_state(struct pipe_blend_state *blend_state, const DWORD *rs)
         blend.rt[1].colormask = rs[D3DRS_COLORWRITEENABLE1];
         blend.rt[2].colormask = rs[D3DRS_COLORWRITEENABLE2];
         blend.rt[3].colormask = rs[D3DRS_COLORWRITEENABLE3];
-        blend.max_rt = 3;
     }
 
     /* blend.force_srgb = !!rs[D3DRS_SRGBWRITEENABLE]; */