radv: move use of NGG to the graphics pipeline key
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13099>
This commit is contained in:

committed by
Marge Bot

parent
0fa431087c
commit
69e656dae4
@@ -217,8 +217,6 @@ radv_get_hash_flags(const struct radv_device *device, bool stats)
|
||||
{
|
||||
uint32_t hash_flags = 0;
|
||||
|
||||
if (device->instance->debug_flags & RADV_DEBUG_NO_NGG)
|
||||
hash_flags |= RADV_HASH_SHADER_NO_NGG;
|
||||
if (device->instance->perftest_flags & RADV_PERFTEST_NGGC)
|
||||
hash_flags |= RADV_HASH_SHADER_FORCE_NGG_CULLING;
|
||||
if (device->physical_device->cs_wave_size == 32)
|
||||
@@ -2727,6 +2725,8 @@ radv_generate_graphics_pipeline_key(const struct radv_pipeline *pipeline,
|
||||
if (pipeline->device->instance->debug_flags & RADV_DEBUG_INVARIANT_GEOM)
|
||||
key.invariant_geom = true;
|
||||
|
||||
key.use_ngg = pipeline->device->physical_device->use_ngg;
|
||||
|
||||
return key;
|
||||
}
|
||||
|
||||
@@ -2832,7 +2832,7 @@ radv_fill_shader_info(struct radv_pipeline *pipeline,
|
||||
infos[MESA_SHADER_VERTEX].vs.as_es = true;
|
||||
}
|
||||
|
||||
if (device->physical_device->use_ngg) {
|
||||
if (pipeline_key->use_ngg) {
|
||||
if (nir[MESA_SHADER_TESS_CTRL]) {
|
||||
infos[MESA_SHADER_TESS_EVAL].is_ngg = true;
|
||||
} else {
|
||||
|
@@ -1654,7 +1654,6 @@ struct radv_event {
|
||||
uint64_t *map;
|
||||
};
|
||||
|
||||
#define RADV_HASH_SHADER_NO_NGG (1 << 0)
|
||||
#define RADV_HASH_SHADER_CS_WAVE32 (1 << 1)
|
||||
#define RADV_HASH_SHADER_PS_WAVE32 (1 << 2)
|
||||
#define RADV_HASH_SHADER_GE_WAVE32 (1 << 3)
|
||||
|
@@ -621,7 +621,7 @@ radv_shader_compile_to_nir(struct radv_device *device, struct vk_shader_module *
|
||||
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)) {
|
||||
if (key->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 |
|
||||
|
@@ -51,6 +51,7 @@ struct radv_pipeline_key {
|
||||
uint32_t has_multiview_view_index : 1;
|
||||
uint32_t optimisations_disabled : 1;
|
||||
uint32_t invariant_geom : 1;
|
||||
uint32_t use_ngg : 1;
|
||||
|
||||
struct {
|
||||
uint32_t instance_rate_inputs;
|
||||
|
Reference in New Issue
Block a user