radv/gfx10: fallback to the legacy path if tess and extreme geometry
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 16 Jul 2019 14:39:16 +0000 (16:39 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 17 Jul 2019 06:32:33 +0000 (08:32 +0200)
This is unsupported and hangs.

This fixes GPU hangs with
dEQP-VK.tessellation.geometry_interaction.limits.output_required_*.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_pipeline.c
src/amd/vulkan/radv_shader.c

index d1eede172dc9ecef18b10c8bf313fcaf5d1a354c..a22e605ca1c6ee95c72c0cbde5d6ba610eee66ad 100644 (file)
@@ -2306,6 +2306,18 @@ radv_fill_shader_keys(struct radv_device *device,
                } else {
                        keys[MESA_SHADER_VERTEX].vs_common_out.as_ngg = true;
                }
+
+               if (nir[MESA_SHADER_TESS_CTRL] &&
+                   nir[MESA_SHADER_GEOMETRY] &&
+                   nir[MESA_SHADER_GEOMETRY]->info.gs.invocations *
+                   nir[MESA_SHADER_GEOMETRY]->info.gs.vertices_out > 256) {
+                       /* Fallback to the legacy path if tessellation is
+                        * enabled with extreme geometry because
+                        * EN_MAX_VERT_OUT_PER_GS_INSTANCE doesn't work and it
+                        * might hang.
+                        */
+                       keys[MESA_SHADER_TESS_EVAL].vs_common_out.as_ngg = false;
+               }
        }
 
        for(int i = 0; i < MESA_SHADER_STAGES; ++i)
index 1e9399de193ff114b9f15ed9df9f266661c8840d..6bafcb2f8692382caf6c632a075dacbb8aa45599 100644 (file)
@@ -796,7 +796,7 @@ static void radv_postprocess_config(const struct radv_physical_device *pdevice,
                break;
        }
 
-       if (pdevice->rad_info.chip_class >= GFX10 &&
+       if (pdevice->rad_info.chip_class >= GFX10 && info->is_ngg &&
            (stage == MESA_SHADER_VERTEX || stage == MESA_SHADER_TESS_EVAL || stage == MESA_SHADER_GEOMETRY)) {
                unsigned gs_vgpr_comp_cnt, es_vgpr_comp_cnt;
                gl_shader_stage es_stage = stage;