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>
This commit is contained in:
Timur Kristóf
2020-10-05 19:35:14 +02:00
parent f11f4a2a4d
commit 17ad2ade82

View File

@@ -553,8 +553,18 @@ radv_shader_compile_to_nir(struct radv_device *device,
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,