radv: rely on shader's wavesize when computing NGG info
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 31 Oct 2019 10:16:24 +0000 (11:16 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 6 Nov 2019 08:20:36 +0000 (09:20 +0100)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_pipeline.c

index b239f024cbeebc8f440c88ddd2a59abf1fb62e0a..533e8c4b0fe5f6b5ce1e7731546903dd98244e18 100644 (file)
@@ -1779,9 +1779,18 @@ gfx10_get_ngg_info(const struct radv_pipeline_key *key,
 
        /* Round up towards full wave sizes for better ALU utilization. */
        if (!max_vert_out_per_gs_instance) {
-               const unsigned wavesize = pipeline->device->physical_device->ge_wave_size;
                unsigned orig_max_esverts;
                unsigned orig_max_gsprims;
+               unsigned wavesize;
+
+               if (gs_type == MESA_SHADER_GEOMETRY) {
+                       wavesize = gs_info->wave_size;
+               } else {
+                       wavesize = nir[MESA_SHADER_TESS_CTRL]
+                               ? infos[MESA_SHADER_TESS_EVAL].wave_size
+                               : infos[MESA_SHADER_VERTEX].wave_size;
+               }
+
                do {
                        orig_max_esverts = max_esverts;
                        orig_max_gsprims = max_gsprims;