radv: Enable ACO for NGG VS/TES, but disable NGG for ACO GS.
authorTimur Kristóf <timur.kristof@gmail.com>
Tue, 31 Mar 2020 08:41:01 +0000 (10:41 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 7 Apr 2020 11:29:35 +0000 (11:29 +0000)
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3576>

src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_pipeline.c

index f45d86bd3f72e5bb29e4bde1acec4cec8ee8fd4d..00e3a7ca94780314e92ea2d483c56f6d737de8d9 100644 (file)
@@ -411,10 +411,6 @@ radv_physical_device_init(struct radv_physical_device *device,
        device->use_ngg = device->rad_info.chip_class >= GFX10 &&
                          device->rad_info.family != CHIP_NAVI14 &&
                          !(device->instance->debug_flags & RADV_DEBUG_NO_NGG);
-       if (device->use_aco && device->use_ngg) {
-               fprintf(stderr, "WARNING: disabling NGG because ACO is used.\n");
-               device->use_ngg = false;
-       }
 
        device->use_ngg_streamout = false;
 
index c62d2a0d9777149bc17b04fda7056cd7c3f64f4b..d1c7abef10666a92bd7eed49540ff2d48a02d9ce 100644 (file)
@@ -2461,6 +2461,19 @@ 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 (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;
 
                for (int i = MESA_SHADER_VERTEX; i <= MESA_SHADER_GEOMETRY; i++) {