radv: adjust IA_MULTI_VGT_PARAM.WD_SWITCH_ON_EOP at draw time
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 7 Jul 2020 16:10:00 +0000 (18:10 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 9 Jul 2020 06:31:39 +0000 (06:31 +0000)
In preparation for the dynamic topology state.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5801>

src/amd/vulkan/radv_pipeline.c
src/amd/vulkan/radv_private.h
src/amd/vulkan/si_cmd_buffer.c

index 52a882297dffae763a26f96119254e66323b3dca..a970c9ef66d08458ca707ad1ce8d7b0a8b5bd923 100644 (file)
@@ -4684,23 +4684,6 @@ radv_compute_ia_multi_vgt_param_helpers(struct radv_pipeline *pipeline,
                if (SI_GS_PER_ES / ia_multi_vgt_param.primgroup_size >= pipeline->device->gs_table_depth - 3)
                        ia_multi_vgt_param.partial_es_wave = true;
 
-       ia_multi_vgt_param.wd_switch_on_eop = false;
-       if (device->physical_device->rad_info.chip_class >= GFX7) {
-               /* WD_SWITCH_ON_EOP has no effect on GPUs with less than
-                * 4 shader engines. Set 1 to pass the assertion below.
-                * The other cases are hardware requirements. */
-               if (device->physical_device->rad_info.max_se < 4 ||
-                   prim == V_008958_DI_PT_POLYGON ||
-                   prim == V_008958_DI_PT_LINELOOP ||
-                   prim == V_008958_DI_PT_TRIFAN ||
-                   prim == V_008958_DI_PT_TRISTRIP_ADJ ||
-                   (pipeline->graphics.prim_restart_enable &&
-                    (device->physical_device->rad_info.family < CHIP_POLARIS10 ||
-                     (prim != V_008958_DI_PT_POINTLIST &&
-                      prim != V_008958_DI_PT_LINESTRIP))))
-                       ia_multi_vgt_param.wd_switch_on_eop = true;
-       }
-
        ia_multi_vgt_param.ia_switch_on_eoi = false;
        if (pipeline->shaders[MESA_SHADER_FRAGMENT]->info.ps.prim_id_input)
                ia_multi_vgt_param.ia_switch_on_eoi = true;
index 52790aea23c0997f116000233b9df944e2bfdf42..0fe611b068de09aaad0a1e7541ecb0fec14d7025 100644 (file)
@@ -1635,7 +1635,6 @@ struct radv_ia_multi_vgt_param_helpers {
        uint32_t base;
        bool partial_es_wave;
        uint8_t primgroup_size;
-       bool wd_switch_on_eop;
        bool ia_switch_on_eoi;
        bool partial_vs_wave;
 };
index 4b73bc513b5148de0b3810e338e56ee83266fca8..c3ac17a87e2ec01ce9c4e70f0847b117e405d547 100644 (file)
@@ -705,6 +705,7 @@ si_get_ia_multi_vgt_param(struct radv_cmd_buffer *cmd_buffer,
        bool ia_switch_on_eoi = false;
        bool partial_vs_wave = false;
        bool partial_es_wave = cmd_buffer->state.pipeline->graphics.ia_multi_vgt_param.partial_es_wave;
+       unsigned topology = cmd_buffer->state.pipeline->graphics.topology;
        bool multi_instances_smaller_than_primgroup;
 
        multi_instances_smaller_than_primgroup = indirect_draw;
@@ -718,7 +719,19 @@ si_get_ia_multi_vgt_param(struct radv_cmd_buffer *cmd_buffer,
        partial_vs_wave = cmd_buffer->state.pipeline->graphics.ia_multi_vgt_param.partial_vs_wave;
 
        if (chip_class >= GFX7) {
-               wd_switch_on_eop = cmd_buffer->state.pipeline->graphics.ia_multi_vgt_param.wd_switch_on_eop;
+               /* WD_SWITCH_ON_EOP has no effect on GPUs with less than
+                * 4 shader engines. Set 1 to pass the assertion below.
+                * The other cases are hardware requirements. */
+               if (cmd_buffer->device->physical_device->rad_info.max_se < 4 ||
+                   topology == V_008958_DI_PT_POLYGON ||
+                   topology == V_008958_DI_PT_LINELOOP ||
+                   topology == V_008958_DI_PT_TRIFAN ||
+                   topology == V_008958_DI_PT_TRISTRIP_ADJ ||
+                   (cmd_buffer->state.pipeline->graphics.prim_restart_enable &&
+                    (cmd_buffer->device->physical_device->rad_info.family < CHIP_POLARIS10 ||
+                     (topology != V_008958_DI_PT_POINTLIST &&
+                      topology != V_008958_DI_PT_LINESTRIP))))
+                       wd_switch_on_eop = true;
 
                /* Hawaii hangs if instancing is enabled and WD_SWITCH_ON_EOP is 0.
                 * We don't know that for indirect drawing, so treat it as