radv: fix geometry shader primitives query with ACO on GFX10
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 16 Apr 2020 14:15:45 +0000 (16:15 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 17 Apr 2020 15:39:16 +0000 (17:39 +0200)
Fixes
dEQP-VK.query_pool.statistics_query.*.geometry_shader_primitives.*.

Fixes: c24d9522dae ("radv: Enable ACO for NGG VS/TES, but disable NGG for ACO GS.")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4593>

src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_pipeline.c
src/amd/vulkan/radv_private.h
src/amd/vulkan/radv_query.c

index 09b19ed0007581935853eaf52bb48fd723331237..8e4fc861722f6fc1c8aa12b2a5a38ab24056dda4 100644 (file)
@@ -412,6 +412,8 @@ radv_physical_device_init(struct radv_physical_device *device,
                          device->rad_info.family != CHIP_NAVI14 &&
                          !(device->instance->debug_flags & RADV_DEBUG_NO_NGG);
 
+       /* TODO: Implement NGG GS with ACO. */
+       device->use_ngg_gs = device->use_ngg && !device->use_aco;
        device->use_ngg_streamout = false;
 
        /* Determine the number of threads per wave for all stages. */
index f0b93878f3b89102cffb4696be0f1a9a698c97c0..b10ee86ac7c1d16f654c4f42fda73c0a84d0b8d9 100644 (file)
@@ -2461,17 +2461,13 @@ radv_fill_shader_keys(struct radv_device *device,
                        keys[MESA_SHADER_TESS_EVAL].vs_common_out.as_ngg = false;
                }
 
-               if (device->physical_device->use_aco) {
-                       /* Disable NGG GS when ACO is used */
+               if (!device->physical_device->use_ngg_gs) {
                        if (nir[MESA_SHADER_GEOMETRY]) {
                                if (nir[MESA_SHADER_TESS_CTRL])
                                        keys[MESA_SHADER_TESS_EVAL].vs_common_out.as_ngg = false;
                                else
                                        keys[MESA_SHADER_VERTEX].vs_common_out.as_ngg = false;
                        }
-
-                       /* NGG streamout not yet supported by ACO */
-                       assert(!device->physical_device->use_ngg_streamout);
                }
 
                gl_shader_stage last_xfb_stage = MESA_SHADER_VERTEX;
index 24a04c4e6a511b458960a3c12d7210d0018bc914..b56772e6edb74fe06cf68e8125e2453064695da9 100644 (file)
@@ -327,6 +327,9 @@ struct radv_physical_device {
        /* Whether to enable NGG. */
        bool use_ngg;
 
+       /* Whether to enable NGG GS. */
+       bool use_ngg_gs;
+
        /* Whether to enable NGG streamout. */
        bool use_ngg_streamout;
 
index a0387c785fa7340c7eeeabcfd870ffaa23025029..07a1c3871871aa91ddf156303fbc618b165b1e71 100644 (file)
@@ -1265,7 +1265,7 @@ radv_query_pool_needs_gds(struct radv_device *device,
         * TODO: fix use of NGG GS and non-NGG GS inside the same begin/end
         * query.
         */
-       return device->physical_device->use_ngg &&
+       return device->physical_device->use_ngg_gs &&
               (pool->pipeline_stats_mask & VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT);
 }