radv/gfx10: add radv_device::use_ngg
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 18 Sep 2019 07:01:38 +0000 (09:01 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 2 Oct 2019 16:06:01 +0000 (18:06 +0200)
Trivial.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_pipeline.c
src/amd/vulkan/radv_private.h

index 1da49cb6093ef8c03796efeb05d51269517fcdcf..d3c412558baa804cfabdfaca38d5e740847cba88 100644 (file)
@@ -372,6 +372,10 @@ radv_physical_device_init(struct radv_physical_device *device,
        device->use_shader_ballot = device->rad_info.chip_class >= GFX8 &&
                                    (device->use_aco || device->instance->perftest_flags & RADV_PERFTEST_SHADER_BALLOT);
 
+       device->use_ngg = device->rad_info.chip_class >= GFX10 &&
+                         device->rad_info.family != CHIP_NAVI14 &&
+                         !(device->instance->debug_flags & RADV_DEBUG_NO_NGG);
+
        device->use_ngg_streamout = false;
 
        /* Determine the number of threads per wave for all stages. */
index ddf94625972263367c023889f9f18d4b8ec8870c..1be8d406a437db7743df64f5f414ee16795d3ed8 100644 (file)
@@ -2309,9 +2309,7 @@ radv_fill_shader_keys(struct radv_device *device,
                        keys[MESA_SHADER_VERTEX].vs_common_out.as_es = true;
        }
 
-       if (device->physical_device->rad_info.chip_class >= GFX10 &&
-           device->physical_device->rad_info.family != CHIP_NAVI14 &&
-           !(device->instance->debug_flags & RADV_DEBUG_NO_NGG)) {
+       if (device->physical_device->use_ngg) {
                if (nir[MESA_SHADER_TESS_CTRL]) {
                        keys[MESA_SHADER_TESS_EVAL].vs_common_out.as_ngg = true;
                } else {
index 0a3e7ca9d881765c577a9e429a30c39fa10e0784..f4c32659d791b428b7ee7621c0a0c509562bd099 100644 (file)
@@ -288,6 +288,9 @@ struct radv_physical_device {
        /* Whether to enable the AMD_shader_ballot extension */
        bool use_shader_ballot;
 
+       /* Whether to enable NGG. */
+       bool use_ngg;
+
        /* Whether to enable NGG streamout. */
        bool use_ngg_streamout;