radv/gfx10: add radv_device::use_ngg
[mesa.git] / src / amd / vulkan / radv_device.c
index 80bd19028d2c1f04b8c56c1338e9d6338d081385..d3c412558baa804cfabdfaca38d5e740847cba88 100644 (file)
@@ -372,8 +372,11 @@ 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;
-       device->use_aco = device->instance->perftest_flags & RADV_PERFTEST_ACO;
 
        /* Determine the number of threads per wave for all stages. */
        device->cs_wave_size = 64;
@@ -487,6 +490,7 @@ static const struct debug_control radv_debug_options[] = {
        {"nongg", RADV_DEBUG_NO_NGG},
        {"noshaderballot", RADV_DEBUG_NO_SHADER_BALLOT},
        {"allentrypoints", RADV_DEBUG_ALL_ENTRYPOINTS},
+       {"metashaders", RADV_DEBUG_DUMP_META_SHADERS},
        {NULL, 0}
 };
 
@@ -555,6 +559,14 @@ radv_handle_per_app_options(struct radv_instance *instance,
                         */
                        instance->perftest_flags |= RADV_PERFTEST_SHADER_BALLOT;
                }
+       } else if (!strcmp(name, "Fledge")) {
+               /*
+                * Zero VRAM for "The Surge 2"
+                *
+                * This avoid a hang when when rendering any level. Likely
+                * uninitialized data in an indirect draw.
+                */
+               instance->debug_flags |= RADV_DEBUG_ZERO_VRAM;
        }
 }
 
@@ -1000,6 +1012,12 @@ void radv_GetPhysicalDeviceFeatures2(
                        features->shaderSharedInt64Atomics = LLVM_VERSION_MAJOR >= 9;
                        break;
                }
+               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT: {
+                       VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT *features =
+                               (VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT *)ext;
+                       features->shaderDemoteToHelperInvocation = pdevice->use_aco;
+                       break;
+               }
                case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT: {
                        VkPhysicalDeviceInlineUniformBlockFeaturesEXT *features =
                                (VkPhysicalDeviceInlineUniformBlockFeaturesEXT *)ext;