radv: make sure to initialize wd_switch_on_eop before checking its value
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 20 Sep 2022 11:32:07 +0000 (13:32 +0200)
committerMarge Bot <emma+marge@anholt.net>
Wed, 21 Sep 2022 18:20:58 +0000 (18:20 +0000)
This is technically not a bug because it might just trigger
SWITCH_ON_EOI when streamout is used and I think it was fine.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7303
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18700>

src/amd/vulkan/si_cmd_buffer.c

index 70aa5a0..565e22d 100644 (file)
@@ -891,6 +891,12 @@ si_get_ia_multi_vgt_param(struct radv_cmd_buffer *cmd_buffer, bool instanced_dra
       if (gfx_level <= GFX8 && info->max_se == 4 && multi_instances_smaller_than_primgroup)
          wd_switch_on_eop = true;
 
+      /* Hardware requirement when drawing primitives from a stream
+       * output buffer.
+       */
+      if (count_from_stream_output)
+         wd_switch_on_eop = true;
+
       /* Required on GFX7 and later. */
       if (info->max_se > 2 && !wd_switch_on_eop)
          ia_switch_on_eoi = true;
@@ -907,12 +913,6 @@ si_get_ia_multi_vgt_param(struct radv_cmd_buffer *cmd_buffer, bool instanced_dra
       if (family == CHIP_BONAIRE && ia_switch_on_eoi && (instanced_draw || indirect_draw))
          partial_vs_wave = true;
 
-      /* Hardware requirement when drawing primitives from a stream
-       * output buffer.
-       */
-      if (count_from_stream_output)
-         wd_switch_on_eop = true;
-
       /* If the WD switch is false, the IA switch must be false too. */
       assert(wd_switch_on_eop || !ia_switch_on_eop);
    }