radv/aco: Use new GS lowering options for ACO with NGG GS.

This makes it easier for ACO to implement NGG GS:

1. No need to keep track of vertex and primitive counts.
2. No need to discard incomplete primitives.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6964>
diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index 5e4d16b..54ce910 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -553,8 +553,18 @@
 
 	nir_shader_gather_info(nir, nir_shader_get_entrypoint(nir));
 
-	if (nir->info.stage == MESA_SHADER_GEOMETRY)
-		nir_lower_gs_intrinsics(nir, nir_lower_gs_intrinsics_per_stream);
+	if (nir->info.stage == MESA_SHADER_GEOMETRY) {
+		unsigned nir_gs_flags = nir_lower_gs_intrinsics_per_stream;
+
+		if (device->physical_device->use_ngg && !radv_use_llvm_for_stage(device, stage)) {
+			/* ACO needs NIR to do some of the hard lifting */
+			nir_gs_flags |= nir_lower_gs_intrinsics_count_primitives |
+			                nir_lower_gs_intrinsics_count_vertices_per_primitive |
+							nir_lower_gs_intrinsics_overwrite_incomplete;
+		}
+
+		nir_lower_gs_intrinsics(nir, nir_gs_flags);
+	}
 
 	static const nir_lower_tex_options tex_options = {
 	  .lower_txp = ~0,