radv: add an option for disabling NGG on GFX10
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 17 Jul 2019 12:19:10 +0000 (14:19 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 17 Jul 2019 13:43:36 +0000 (15:43 +0200)
Will be useful for testing the legacy path.

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

index 75e28000e1457693cfa0e2f747e28939df517908..723fabda57f2b709fd0b052287f41762baf34e63 100644 (file)
@@ -52,6 +52,7 @@ enum {
        RADV_DEBUG_NOTHREADLLVM      = 0x400000,
        RADV_DEBUG_NOBINNING         = 0x800000,
        RADV_DEBUG_NO_LOAD_STORE_OPT = 0x1000000,
+       RADV_DEBUG_NO_NGG            = 0x2000000,
 };
 
 enum {
index 9e77dc7cb16037493ed89a3a511cfad0f5d224cc..b397a9a8aa06b7576b704891e1a66f7b992c307e 100644 (file)
@@ -476,6 +476,7 @@ static const struct debug_control radv_debug_options[] = {
        {"nothreadllvm", RADV_DEBUG_NOTHREADLLVM},
        {"nobinning", RADV_DEBUG_NOBINNING},
        {"noloadstoreopt", RADV_DEBUG_NO_LOAD_STORE_OPT},
+       {"nongg", RADV_DEBUG_NO_NGG},
        {NULL, 0}
 };
 
index a3323ae8135d0595721d9d2ea5ab55307001817e..b1b90c8b0358f1826211a2e9e9018fb75db4497e 100644 (file)
@@ -173,6 +173,8 @@ static uint32_t get_hash_flags(struct radv_device *device)
 
        if (device->instance->debug_flags & RADV_DEBUG_UNSAFE_MATH)
                hash_flags |= RADV_HASH_SHADER_UNSAFE_MATH;
+       if (device->instance->debug_flags & RADV_DEBUG_NO_NGG)
+               hash_flags |= RADV_HASH_SHADER_NO_NGG;
        if (device->instance->perftest_flags & RADV_PERFTEST_SISCHED)
                hash_flags |= RADV_HASH_SHADER_SISCHED;
        return hash_flags;
@@ -2300,7 +2302,8 @@ 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) {
+       if (device->physical_device->rad_info.chip_class >= GFX10 &&
+           !(device->instance->debug_flags & RADV_DEBUG_NO_NGG)) {
                if (nir[MESA_SHADER_TESS_CTRL]) {
                        keys[MESA_SHADER_TESS_EVAL].vs_common_out.as_ngg = true;
                } else {
index 29809ea53bedb9060a3d347dec326b4600b2d1c5..931d403939795041273c7dcc71bd2c57cae76942 100644 (file)
@@ -1391,6 +1391,8 @@ struct radv_shader_module;
 #define RADV_HASH_SHADER_IS_GEOM_COPY_SHADER (1 << 0)
 #define RADV_HASH_SHADER_SISCHED             (1 << 1)
 #define RADV_HASH_SHADER_UNSAFE_MATH         (1 << 2)
+#define RADV_HASH_SHADER_NO_NGG              (1 << 3)
+
 void
 radv_hash_shaders(unsigned char *hash,
                  const VkPipelineShaderStageCreateInfo **stages,