radv/gfx10: add a separate flag for creating a GDS OA buffer
[mesa.git] / src / amd / vulkan / radv_device.c
index 76e191a93a876b169fcbd800e7d40561c1b4c5fb..ef0e866ef52b12c8555e1b0bfcd2e9b6a8776103 100644 (file)
@@ -398,10 +398,6 @@ radv_physical_device_init(struct radv_physical_device *device,
        radv_handle_env_var_force_family(device);
 
        device->use_aco = instance->perftest_flags & RADV_PERFTEST_ACO;
-       if (device->rad_info.chip_class < GFX7 && device->use_aco) {
-               fprintf(stderr, "WARNING: disabling ACO on unsupported GPUs.\n");
-               device->use_aco = false;
-       }
 
        snprintf(device->name, sizeof(device->name),
                 "AMD RADV%s %s (LLVM " MESA_LLVM_VERSION_STRING ")", device->use_aco ? "/ACO" : "",
@@ -426,8 +422,7 @@ radv_physical_device_init(struct radv_physical_device *device,
        disk_cache_format_hex_id(buf, device->cache_uuid, VK_UUID_SIZE * 2);
        device->disk_cache = disk_cache_create(device->name, buf, shader_env_flags);
 
-       if (device->rad_info.chip_class < GFX8 ||
-           device->rad_info.chip_class > GFX9)
+       if (device->rad_info.chip_class < GFX8)
                fprintf(stderr, "WARNING: radv is not a conformant vulkan implementation, testing use only.\n");
 
        radv_get_driver_uuid(&device->driver_uuid);
@@ -1064,9 +1059,9 @@ void radv_GetPhysicalDeviceFeatures2(
                        features->bufferDeviceAddressMultiDevice = false;
                        break;
                }
-               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_KHR: {
-                       VkPhysicalDeviceBufferDeviceAddressFeaturesKHR *features =
-                               (VkPhysicalDeviceBufferDeviceAddressFeaturesKHR *)ext;
+               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES: {
+                       VkPhysicalDeviceBufferDeviceAddressFeatures *features =
+                               (VkPhysicalDeviceBufferDeviceAddressFeatures *)ext;
                        features->bufferDeviceAddress = true;
                        features->bufferDeviceAddressCaptureReplay = false;
                        features->bufferDeviceAddressMultiDevice = false;
@@ -1093,16 +1088,16 @@ void radv_GetPhysicalDeviceFeatures2(
                        features->storagePushConstant8 = enabled;
                        break;
                }
-               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES_KHR: {
-                       VkPhysicalDeviceShaderFloat16Int8FeaturesKHR *features =
-                               (VkPhysicalDeviceShaderFloat16Int8FeaturesKHR*)ext;
+               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES: {
+                       VkPhysicalDeviceShaderFloat16Int8Features *features =
+                               (VkPhysicalDeviceShaderFloat16Int8Features*)ext;
                        features->shaderFloat16 = pdevice->rad_info.chip_class >= GFX8 && !pdevice->use_aco;
                        features->shaderInt8 = !pdevice->use_aco;
                        break;
                }
-               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES_KHR: {
-                       VkPhysicalDeviceShaderAtomicInt64FeaturesKHR *features =
-                               (VkPhysicalDeviceShaderAtomicInt64FeaturesKHR *)ext;
+               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES: {
+                       VkPhysicalDeviceShaderAtomicInt64Features *features =
+                               (VkPhysicalDeviceShaderAtomicInt64Features *)ext;
                        features->shaderBufferInt64Atomics = LLVM_VERSION_MAJOR >= 9;
                        features->shaderSharedInt64Atomics = LLVM_VERSION_MAJOR >= 9;
                        break;
@@ -1134,9 +1129,9 @@ void radv_GetPhysicalDeviceFeatures2(
                        features->ycbcrImageArrays = true;
                        break;
                }
-               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES_KHR: {
-                       VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR *features =
-                               (VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR *)ext;
+               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES: {
+                       VkPhysicalDeviceUniformBufferStandardLayoutFeatures *features =
+                               (VkPhysicalDeviceUniformBufferStandardLayoutFeatures *)ext;
                        features->uniformBufferStandardLayout = true;
                        break;
                }
@@ -1146,9 +1141,9 @@ void radv_GetPhysicalDeviceFeatures2(
                        features->indexTypeUint8 = pdevice->rad_info.chip_class >= GFX8;
                        break;
                }
-               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES_KHR: {
-                       VkPhysicalDeviceImagelessFramebufferFeaturesKHR *features =
-                               (VkPhysicalDeviceImagelessFramebufferFeaturesKHR *)ext;
+               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES: {
+                       VkPhysicalDeviceImagelessFramebufferFeatures *features =
+                               (VkPhysicalDeviceImagelessFramebufferFeatures *)ext;
                        features->imagelessFramebuffer = true;
                        break;
                }
@@ -1171,9 +1166,9 @@ void radv_GetPhysicalDeviceFeatures2(
                        features->texelBufferAlignment = true;
                        break;
                }
-               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES_KHR: {
-                       VkPhysicalDeviceTimelineSemaphoreFeaturesKHR *features =
-                               (VkPhysicalDeviceTimelineSemaphoreFeaturesKHR *) ext;
+               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES: {
+                       VkPhysicalDeviceTimelineSemaphoreFeatures *features =
+                               (VkPhysicalDeviceTimelineSemaphoreFeatures *) ext;
                        features->timelineSemaphore = true;
                        break;
                }
@@ -1190,9 +1185,9 @@ void radv_GetPhysicalDeviceFeatures2(
                        features->deviceCoherentMemory = pdevice->rad_info.has_l2_uncached;
                        break;
                }
-               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES_KHR: {
-                       VkPhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR *features =
-                               (VkPhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR *)ext;
+               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES: {
+                       VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures *features =
+                               (VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures *)ext;
                        features->shaderSubgroupExtendedTypes = true;
                        break;
                }
@@ -1202,6 +1197,75 @@ void radv_GetPhysicalDeviceFeatures2(
                        features->separateDepthStencilLayouts = true;
                        break;
                }
+               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES: {
+                       VkPhysicalDeviceVulkan11Features *features =
+                               (VkPhysicalDeviceVulkan11Features *)ext;
+                       features->storageBuffer16BitAccess = pdevice->rad_info.chip_class >= GFX8 && !pdevice->use_aco;
+                       features->uniformAndStorageBuffer16BitAccess = pdevice->rad_info.chip_class >= GFX8 && !pdevice->use_aco;
+                       features->storagePushConstant16 = pdevice->rad_info.chip_class >= GFX8 && !pdevice->use_aco;
+                       features->storageInputOutput16 = pdevice->rad_info.chip_class >= GFX8 && !pdevice->use_aco && LLVM_VERSION_MAJOR >= 9;
+                       features->multiview = true;
+                       features->multiviewGeometryShader = true;
+                       features->multiviewTessellationShader = true;
+                       features->variablePointersStorageBuffer = true;
+                       features->variablePointers = true;
+                       features->protectedMemory = false;
+                       features->samplerYcbcrConversion = true;
+                       features->shaderDrawParameters = true;
+                       break;
+               }
+               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES: {
+                       VkPhysicalDeviceVulkan12Features *features =
+                               (VkPhysicalDeviceVulkan12Features *)ext;
+                       features->samplerMirrorClampToEdge = true;
+                       features->drawIndirectCount = true;
+                       features->storageBuffer8BitAccess = pdevice->rad_info.chip_class >= GFX8 && !pdevice->use_aco;
+                       features->uniformAndStorageBuffer8BitAccess = pdevice->rad_info.chip_class >= GFX8 && !pdevice->use_aco;
+                       features->storagePushConstant8 = pdevice->rad_info.chip_class >= GFX8 && !pdevice->use_aco;
+                       features->shaderBufferInt64Atomics = LLVM_VERSION_MAJOR >= 9;
+                       features->shaderSharedInt64Atomics = LLVM_VERSION_MAJOR >= 9;
+                       features->shaderFloat16 = pdevice->rad_info.chip_class >= GFX8 && !pdevice->use_aco;
+                       features->shaderInt8 = !pdevice->use_aco;
+                       features->descriptorIndexing = true;
+                       features->shaderInputAttachmentArrayDynamicIndexing = true;
+                       features->shaderUniformTexelBufferArrayDynamicIndexing = true;
+                       features->shaderStorageTexelBufferArrayDynamicIndexing = true;
+                       features->shaderUniformBufferArrayNonUniformIndexing = true;
+                       features->shaderSampledImageArrayNonUniformIndexing = true;
+                       features->shaderStorageBufferArrayNonUniformIndexing = true;
+                       features->shaderStorageImageArrayNonUniformIndexing = true;
+                       features->shaderInputAttachmentArrayNonUniformIndexing = true;
+                       features->shaderUniformTexelBufferArrayNonUniformIndexing = true;
+                       features->shaderStorageTexelBufferArrayNonUniformIndexing = true;
+                       features->descriptorBindingUniformBufferUpdateAfterBind = true;
+                       features->descriptorBindingSampledImageUpdateAfterBind = true;
+                       features->descriptorBindingStorageImageUpdateAfterBind = true;
+                       features->descriptorBindingStorageBufferUpdateAfterBind = true;
+                       features->descriptorBindingUniformTexelBufferUpdateAfterBind = true;
+                       features->descriptorBindingStorageTexelBufferUpdateAfterBind = true;
+                       features->descriptorBindingUpdateUnusedWhilePending = true;
+                       features->descriptorBindingPartiallyBound = true;
+                       features->descriptorBindingVariableDescriptorCount = true;
+                       features->runtimeDescriptorArray = true;
+                       features->samplerFilterMinmax = pdevice->rad_info.chip_class >= GFX7;
+                       features->scalarBlockLayout = pdevice->rad_info.chip_class >= GFX7;
+                       features->imagelessFramebuffer = true;
+                       features->uniformBufferStandardLayout = true;
+                       features->shaderSubgroupExtendedTypes = true;
+                       features->separateDepthStencilLayouts = true;
+                       features->hostQueryReset = true;
+                       features->timelineSemaphore = pdevice->rad_info.has_syncobj_wait_for_submit;
+                       features->bufferDeviceAddress = true;
+                       features->bufferDeviceAddressCaptureReplay = false;
+                       features->bufferDeviceAddressMultiDevice = false;
+                       features->vulkanMemoryModel = false;
+                       features->vulkanMemoryModelDeviceScope = false;
+                       features->vulkanMemoryModelAvailabilityVisibilityChains = false;
+                       features->shaderOutputViewportIndex = true;
+                       features->shaderOutputLayer = true;
+                       features->subgroupBroadcastDynamicId = true;
+                       break;
+               }
                default:
                        break;
                }
@@ -1558,20 +1622,20 @@ void radv_GetPhysicalDeviceProperties2(
                        properties->pciFunction = pdevice->bus_info.func;
                        break;
                }
-               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR: {
-                       VkPhysicalDeviceDriverPropertiesKHR *driver_props =
-                               (VkPhysicalDeviceDriverPropertiesKHR *) ext;
+               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES: {
+                       VkPhysicalDeviceDriverProperties *driver_props =
+                               (VkPhysicalDeviceDriverProperties *) ext;
 
-                       driver_props->driverID = VK_DRIVER_ID_MESA_RADV_KHR;
-                       snprintf(driver_props->driverName, VK_MAX_DRIVER_NAME_SIZE_KHR, "radv");
-                       snprintf(driver_props->driverInfo, VK_MAX_DRIVER_INFO_SIZE_KHR,
+                       driver_props->driverID = VK_DRIVER_ID_MESA_RADV;
+                       snprintf(driver_props->driverName, VK_MAX_DRIVER_NAME_SIZE, "radv");
+                       snprintf(driver_props->driverInfo, VK_MAX_DRIVER_INFO_SIZE,
                                "Mesa " PACKAGE_VERSION MESA_GIT_SHA1
                                " (LLVM " MESA_LLVM_VERSION_STRING ")");
 
-                       driver_props->conformanceVersion = (VkConformanceVersionKHR) {
+                       driver_props->conformanceVersion = (VkConformanceVersion) {
                                .major = 1,
-                               .minor = 1,
-                               .subminor = 2,
+                               .minor = 2,
+                               .subminor = 0,
                                .patch = 0,
                        };
                        break;
@@ -1615,9 +1679,9 @@ void radv_GetPhysicalDeviceProperties2(
                        properties->variableSampleLocations = false;
                        break;
                }
-               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES_KHR: {
-                       VkPhysicalDeviceDepthStencilResolvePropertiesKHR *properties =
-                               (VkPhysicalDeviceDepthStencilResolvePropertiesKHR *)ext;
+               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES: {
+                       VkPhysicalDeviceDepthStencilResolveProperties *properties =
+                               (VkPhysicalDeviceDepthStencilResolveProperties *)ext;
 
                        /* We support all of the depth resolve modes */
                        properties->supportedDepthResolveModes =
@@ -1645,16 +1709,16 @@ void radv_GetPhysicalDeviceProperties2(
                        properties->uniformTexelBufferOffsetSingleTexelAlignment = true;
                        break;
                }
-               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES_KHR : {
-                       VkPhysicalDeviceFloatControlsPropertiesKHR *properties =
-                               (VkPhysicalDeviceFloatControlsPropertiesKHR *)ext;
+               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES : {
+                       VkPhysicalDeviceFloatControlsProperties *properties =
+                               (VkPhysicalDeviceFloatControlsProperties *)ext;
 
                        /* On AMD hardware, denormals and rounding modes for
                         * fp16/fp64 are controlled by the same config
                         * register.
                         */
-                       properties->denormBehaviorIndependence = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY_KHR;
-                       properties->roundingModeIndependence = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY_KHR;
+                       properties->denormBehaviorIndependence = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY;
+                       properties->roundingModeIndependence = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY;
 
                        /* Do not allow both preserving and flushing denorms
                         * because different shaders in the same pipeline can
@@ -1685,9 +1749,9 @@ void radv_GetPhysicalDeviceProperties2(
                        properties->shaderSignedZeroInfNanPreserveFloat64 = pdevice->rad_info.chip_class >= GFX8;
                        break;
                }
-               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES_KHR: {
-                       VkPhysicalDeviceTimelineSemaphorePropertiesKHR *props =
-                               (VkPhysicalDeviceTimelineSemaphorePropertiesKHR *) ext;
+               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES: {
+                       VkPhysicalDeviceTimelineSemaphoreProperties *props =
+                               (VkPhysicalDeviceTimelineSemaphoreProperties *) ext;
                        props->maxTimelineSemaphoreValueDifference = UINT64_MAX;
                        break;
                }
@@ -1706,6 +1770,138 @@ void radv_GetPhysicalDeviceProperties2(
                        }
                        break;
                }
+               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES: {
+                       VkPhysicalDeviceVulkan11Properties *props =
+                               (VkPhysicalDeviceVulkan11Properties *)ext;
+
+                       memcpy(props->deviceUUID, pdevice->device_uuid, VK_UUID_SIZE);
+                       memcpy(props->driverUUID, pdevice->driver_uuid, VK_UUID_SIZE);
+                       memset(props->deviceLUID, 0, VK_LUID_SIZE);
+                       /* The LUID is for Windows. */
+                       props->deviceLUIDValid = false;
+                       props->deviceNodeMask = 0;
+                       {
+                               props->subgroupSize = RADV_SUBGROUP_SIZE;
+                               props->subgroupSupportedStages = VK_SHADER_STAGE_ALL;
+                               props->subgroupSupportedOperations =
+                                                       VK_SUBGROUP_FEATURE_BASIC_BIT |
+                                                       VK_SUBGROUP_FEATURE_VOTE_BIT |
+                                                       VK_SUBGROUP_FEATURE_ARITHMETIC_BIT |
+                                                       VK_SUBGROUP_FEATURE_BALLOT_BIT |
+                                                       VK_SUBGROUP_FEATURE_CLUSTERED_BIT |
+                                                       VK_SUBGROUP_FEATURE_QUAD_BIT;
+                               if (pdevice->rad_info.chip_class == GFX8 ||
+                                   pdevice->rad_info.chip_class == GFX9) {
+                                       props->subgroupSupportedOperations |=
+                                                                       VK_SUBGROUP_FEATURE_SHUFFLE_BIT |
+                                                                       VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT;
+                               }
+                               props->subgroupQuadOperationsInAllStages = true;
+                       }
+                       props->pointClippingBehavior = VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES;
+                       props->maxMultiviewViewCount = MAX_VIEWS;
+                       props->maxMultiviewInstanceIndex = INT_MAX;
+                       props->protectedNoFault = false;
+                       props->maxPerSetDescriptors = RADV_MAX_PER_SET_DESCRIPTORS;
+                       props->maxMemoryAllocationSize = RADV_MAX_MEMORY_ALLOCATION_SIZE;
+                       break;
+               }
+               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES: {
+                       VkPhysicalDeviceVulkan12Properties *props =
+                               (VkPhysicalDeviceVulkan12Properties *)ext;
+
+                       {
+                               props->driverID = VK_DRIVER_ID_MESA_RADV;
+                               snprintf(props->driverName, VK_MAX_DRIVER_NAME_SIZE, "radv");
+                               snprintf(props->driverInfo, VK_MAX_DRIVER_INFO_SIZE,
+                                        "Mesa " PACKAGE_VERSION MESA_GIT_SHA1
+                                        " (LLVM " MESA_LLVM_VERSION_STRING ")");
+
+                               props->conformanceVersion = (VkConformanceVersion) {
+                                       .major = 1,
+                                       .minor = 1,
+                                       .subminor = 2,
+                                       .patch = 0,
+                               };
+                       }
+
+                       props->denormBehaviorIndependence = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY_KHR;
+                       props->roundingModeIndependence = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY_KHR;
+
+                       props->shaderDenormFlushToZeroFloat32 = true;
+                       props->shaderDenormPreserveFloat32 = false;
+                       props->shaderRoundingModeRTEFloat32 = true;
+                       props->shaderRoundingModeRTZFloat32 = false;
+                       props->shaderSignedZeroInfNanPreserveFloat32 = true;
+
+                       props->shaderDenormFlushToZeroFloat16 = false;
+                       props->shaderDenormPreserveFloat16 = pdevice->rad_info.chip_class >= GFX8;
+                       props->shaderRoundingModeRTEFloat16 = pdevice->rad_info.chip_class >= GFX8;
+                       props->shaderRoundingModeRTZFloat16 = false;
+                       props->shaderSignedZeroInfNanPreserveFloat16 = pdevice->rad_info.chip_class >= GFX8;
+
+                       props->shaderDenormFlushToZeroFloat64 = false;
+                       props->shaderDenormPreserveFloat64 = pdevice->rad_info.chip_class >= GFX8;
+                       props->shaderRoundingModeRTEFloat64 = pdevice->rad_info.chip_class >= GFX8;
+                       props->shaderRoundingModeRTZFloat64 = false;
+                       props->shaderSignedZeroInfNanPreserveFloat64 = pdevice->rad_info.chip_class >= GFX8;
+
+                       props->maxUpdateAfterBindDescriptorsInAllPools = UINT32_MAX / 64;
+                       props->shaderUniformBufferArrayNonUniformIndexingNative = false;
+                       props->shaderSampledImageArrayNonUniformIndexingNative = false;
+                       props->shaderStorageBufferArrayNonUniformIndexingNative = false;
+                       props->shaderStorageImageArrayNonUniformIndexingNative = false;
+                       props->shaderInputAttachmentArrayNonUniformIndexingNative = false;
+                       props->robustBufferAccessUpdateAfterBind = false;
+                       props->quadDivergentImplicitLod = false;
+
+                       size_t max_descriptor_set_size = ((1ull << 31) - 16 * MAX_DYNAMIC_BUFFERS -
+                               MAX_INLINE_UNIFORM_BLOCK_SIZE * MAX_INLINE_UNIFORM_BLOCK_COUNT) /
+                                 (32 /* uniform buffer, 32 due to potential space wasted on alignment */ +
+                                  32 /* storage buffer, 32 due to potential space wasted on alignment */ +
+                                  32 /* sampler, largest when combined with image */ +
+                                  64 /* sampled image */ +
+                                  64 /* storage image */);
+                       props->maxPerStageDescriptorUpdateAfterBindSamplers = max_descriptor_set_size;
+                       props->maxPerStageDescriptorUpdateAfterBindUniformBuffers = max_descriptor_set_size;
+                       props->maxPerStageDescriptorUpdateAfterBindStorageBuffers = max_descriptor_set_size;
+                       props->maxPerStageDescriptorUpdateAfterBindSampledImages = max_descriptor_set_size;
+                       props->maxPerStageDescriptorUpdateAfterBindStorageImages = max_descriptor_set_size;
+                       props->maxPerStageDescriptorUpdateAfterBindInputAttachments = max_descriptor_set_size;
+                       props->maxPerStageUpdateAfterBindResources = max_descriptor_set_size;
+                       props->maxDescriptorSetUpdateAfterBindSamplers = max_descriptor_set_size;
+                       props->maxDescriptorSetUpdateAfterBindUniformBuffers = max_descriptor_set_size;
+                       props->maxDescriptorSetUpdateAfterBindUniformBuffersDynamic = MAX_DYNAMIC_UNIFORM_BUFFERS;
+                       props->maxDescriptorSetUpdateAfterBindStorageBuffers = max_descriptor_set_size;
+                       props->maxDescriptorSetUpdateAfterBindStorageBuffersDynamic = MAX_DYNAMIC_STORAGE_BUFFERS;
+                       props->maxDescriptorSetUpdateAfterBindSampledImages = max_descriptor_set_size;
+                       props->maxDescriptorSetUpdateAfterBindStorageImages = max_descriptor_set_size;
+                       props->maxDescriptorSetUpdateAfterBindInputAttachments = max_descriptor_set_size;
+
+                       /* We support all of the depth resolve modes */
+                       props->supportedDepthResolveModes =
+                               VK_RESOLVE_MODE_SAMPLE_ZERO_BIT_KHR |
+                               VK_RESOLVE_MODE_AVERAGE_BIT_KHR |
+                               VK_RESOLVE_MODE_MIN_BIT_KHR |
+                               VK_RESOLVE_MODE_MAX_BIT_KHR;
+
+                       /* Average doesn't make sense for stencil so we don't support that */
+                       props->supportedStencilResolveModes =
+                               VK_RESOLVE_MODE_SAMPLE_ZERO_BIT_KHR |
+                               VK_RESOLVE_MODE_MIN_BIT_KHR |
+                               VK_RESOLVE_MODE_MAX_BIT_KHR;
+
+                       props->independentResolveNone = true;
+                       props->independentResolve = true;
+
+                       props->filterMinmaxImageComponentMapping = pdevice->rad_info.chip_class >= GFX9;
+                       props->filterMinmaxSingleComponentFormats = true;
+
+                       props->maxTimelineSemaphoreValueDifference = UINT64_MAX;
+
+                       props->framebufferIntegerColorSampleCounts = VK_SAMPLE_COUNT_1_BIT;
+                       break;
+               }
                default:
                        break;
                }
@@ -3439,6 +3635,7 @@ radv_get_preamble_cs(struct radv_queue *queue,
                     uint32_t gsvs_ring_size,
                     bool needs_tess_rings,
                     bool needs_gds,
+                    bool needs_gds_oa,
                     bool needs_sample_positions,
                     struct radeon_cmdbuf **initial_full_flush_preamble_cs,
                      struct radeon_cmdbuf **initial_preamble_cs,
@@ -3453,7 +3650,7 @@ radv_get_preamble_cs(struct radv_queue *queue,
        struct radeon_winsys_bo *gds_bo = NULL;
        struct radeon_winsys_bo *gds_oa_bo = NULL;
        struct radeon_cmdbuf *dest_cs[3] = {0};
-       bool add_tess_rings = false, add_gds = false, add_sample_positions = false;
+       bool add_tess_rings = false, add_gds = false, add_gds_oa = false, add_sample_positions = false;
        unsigned tess_factor_ring_size = 0, tess_offchip_ring_size = 0;
        unsigned max_offchip_buffers;
        unsigned hs_offchip_param = 0;
@@ -3467,6 +3664,10 @@ radv_get_preamble_cs(struct radv_queue *queue,
                if (needs_gds)
                        add_gds = true;
        }
+       if (!queue->has_gds_oa) {
+               if (needs_gds_oa)
+                       add_gds_oa = true;
+       }
        if (!queue->has_sample_positions) {
                if (needs_sample_positions)
                        add_sample_positions = true;
@@ -3496,14 +3697,14 @@ radv_get_preamble_cs(struct radv_queue *queue,
            compute_scratch_waves <= queue->compute_scratch_waves &&
            esgs_ring_size <= queue->esgs_ring_size &&
            gsvs_ring_size <= queue->gsvs_ring_size &&
-           !add_tess_rings && !add_gds && !add_sample_positions &&
+           !add_tess_rings && !add_gds && !add_gds_oa && !add_sample_positions &&
            queue->initial_preamble_cs) {
                *initial_full_flush_preamble_cs = queue->initial_full_flush_preamble_cs;
                *initial_preamble_cs = queue->initial_preamble_cs;
                *continue_preamble_cs = queue->continue_preamble_cs;
                if (!scratch_size_per_wave && !compute_scratch_size_per_wave &&
                    !esgs_ring_size && !gsvs_ring_size && !needs_tess_rings &&
-                   !needs_gds && !needs_sample_positions)
+                   !needs_gds && !needs_gds_oa && !needs_sample_positions)
                        *continue_preamble_cs = NULL;
                return VK_SUCCESS;
        }
@@ -3591,6 +3792,12 @@ radv_get_preamble_cs(struct radv_queue *queue,
                                                          RADV_BO_PRIORITY_SCRATCH);
                if (!gds_bo)
                        goto fail;
+       } else {
+               gds_bo = queue->gds_bo;
+       }
+
+       if (add_gds_oa) {
+               assert(queue->device->physical_device->rad_info.chip_class >= GFX10);
 
                gds_oa_bo = queue->device->ws->buffer_create(queue->device->ws,
                                                             4, 1,
@@ -3600,7 +3807,6 @@ radv_get_preamble_cs(struct radv_queue *queue,
                if (!gds_oa_bo)
                        goto fail;
        } else {
-               gds_bo = queue->gds_bo;
                gds_oa_bo = queue->gds_oa_bo;
        }
 
@@ -3784,8 +3990,10 @@ radv_get_preamble_cs(struct radv_queue *queue,
                queue->has_gds = true;
        }
 
-       if (gds_oa_bo != queue->gds_oa_bo)
+       if (gds_oa_bo != queue->gds_oa_bo) {
                queue->gds_oa_bo = gds_oa_bo;
+               queue->has_gds_oa = true;
+       }
 
        if (descriptor_bo != queue->descriptor_bo) {
                if (queue->descriptor_bo)
@@ -4056,6 +4264,7 @@ radv_get_preambles(struct radv_queue *queue,
        uint32_t esgs_ring_size = 0, gsvs_ring_size = 0;
        bool tess_rings_needed = false;
        bool gds_needed = false;
+       bool gds_oa_needed = false;
        bool sample_positions_needed = false;
 
        for (uint32_t j = 0; j < cmd_buffer_count; j++) {
@@ -4072,13 +4281,14 @@ radv_get_preambles(struct radv_queue *queue,
                gsvs_ring_size = MAX2(gsvs_ring_size, cmd_buffer->gsvs_ring_size_needed);
                tess_rings_needed |= cmd_buffer->tess_rings_needed;
                gds_needed |= cmd_buffer->gds_needed;
+               gds_oa_needed |= cmd_buffer->gds_oa_needed;
                sample_positions_needed |= cmd_buffer->sample_positions_needed;
        }
 
        return radv_get_preamble_cs(queue, scratch_size_per_wave, waves_wanted,
                                    compute_scratch_size_per_wave, compute_waves_wanted,
                                    esgs_ring_size, gsvs_ring_size, tess_rings_needed,
-                                   gds_needed, sample_positions_needed,
+                                   gds_needed, gds_oa_needed, sample_positions_needed,
                                    initial_full_flush_preamble_cs,
                                    initial_preamble_cs, continue_preamble_cs);
 }
@@ -4508,8 +4718,8 @@ VkResult radv_QueueSubmit(
                        wait_dst_stage_mask |= pSubmits[i].pWaitDstStageMask[j];
                }
 
-               const VkTimelineSemaphoreSubmitInfoKHR *timeline_info =
-                       vk_find_struct_const(pSubmits[i].pNext, TIMELINE_SEMAPHORE_SUBMIT_INFO_KHR);
+               const VkTimelineSemaphoreSubmitInfo *timeline_info =
+                       vk_find_struct_const(pSubmits[i].pNext, TIMELINE_SEMAPHORE_SUBMIT_INFO);
 
                result = radv_queue_submit(queue, &(struct radv_queue_submission) {
                                .cmd_buffers = pSubmits[i].pCommandBuffers,
@@ -4862,7 +5072,6 @@ static VkResult radv_alloc_memory(struct radv_device *device,
 
 fail:
        radv_free_memory(device, pAllocator,mem);
-       vk_free2(&device->alloc, pAllocator, mem);
 
        return result;
 }
@@ -5153,8 +5362,8 @@ static bool radv_sparse_bind_has_effects(const VkBindSparseInfo *info)
                if (i != fence_idx && !radv_sparse_bind_has_effects(pBindInfo + i))
                        continue;
 
-               const VkTimelineSemaphoreSubmitInfoKHR *timeline_info =
-                       vk_find_struct_const(pBindInfo[i].pNext, TIMELINE_SEMAPHORE_SUBMIT_INFO_KHR);
+               const VkTimelineSemaphoreSubmitInfo *timeline_info =
+                       vk_find_struct_const(pBindInfo[i].pNext, TIMELINE_SEMAPHORE_SUBMIT_INFO);
 
                VkResult result = radv_queue_submit(queue, &(struct radv_queue_submission) {
                                .buffer_binds = pBindInfo[i].pBufferBinds,
@@ -5638,11 +5847,11 @@ void radv_destroy_semaphore_part(struct radv_device *device,
 static VkSemaphoreTypeKHR
 radv_get_semaphore_type(const void *pNext, uint64_t *initial_value)
 {
-       const VkSemaphoreTypeCreateInfoKHR *type_info =
-               vk_find_struct_const(pNext, SEMAPHORE_TYPE_CREATE_INFO_KHR);
+       const VkSemaphoreTypeCreateInfo *type_info =
+               vk_find_struct_const(pNext, SEMAPHORE_TYPE_CREATE_INFO);
 
        if (!type_info)
-               return VK_SEMAPHORE_TYPE_BINARY_KHR;
+               return VK_SEMAPHORE_TYPE_BINARY;
 
        if (initial_value)
                *initial_value = type_info->initialValue;
@@ -5672,7 +5881,7 @@ VkResult radv_CreateSemaphore(
        sem->temporary.kind = RADV_SEMAPHORE_NONE;
        sem->permanent.kind = RADV_SEMAPHORE_NONE;
 
-       if (type == VK_SEMAPHORE_TYPE_TIMELINE_KHR) {
+       if (type == VK_SEMAPHORE_TYPE_TIMELINE) {
                radv_create_timeline(&sem->permanent.timeline, initial_value);
                sem->permanent.kind = RADV_SEMAPHORE_TIMELINE;
        } else if (device->always_use_syncobj || handleTypes) {
@@ -5712,9 +5921,9 @@ void radv_DestroySemaphore(
 }
 
 VkResult
-radv_GetSemaphoreCounterValueKHR(VkDevice _device,
-                                 VkSemaphore _semaphore,
-                                 uint64_t* pValue)
+radv_GetSemaphoreCounterValue(VkDevice _device,
+                             VkSemaphore _semaphore,
+                             uint64_t* pValue)
 {
        RADV_FROM_HANDLE(radv_device, device, _device);
        RADV_FROM_HANDLE(radv_semaphore, semaphore, _semaphore);
@@ -5741,7 +5950,7 @@ radv_GetSemaphoreCounterValueKHR(VkDevice _device,
 
 static VkResult
 radv_wait_timelines(struct radv_device *device,
-                    const VkSemaphoreWaitInfoKHR* pWaitInfo,
+                    const VkSemaphoreWaitInfo* pWaitInfo,
                     uint64_t abs_timeout)
 {
        if ((pWaitInfo->flags & VK_SEMAPHORE_WAIT_ANY_BIT_KHR) && pWaitInfo->semaphoreCount > 1) {
@@ -5772,9 +5981,9 @@ radv_wait_timelines(struct radv_device *device,
        return VK_SUCCESS;
 }
 VkResult
-radv_WaitSemaphoresKHR(VkDevice _device,
-                       const VkSemaphoreWaitInfoKHR* pWaitInfo,
-                       uint64_t timeout)
+radv_WaitSemaphores(VkDevice _device,
+                   const VkSemaphoreWaitInfo* pWaitInfo,
+                   uint64_t timeout)
 {
        RADV_FROM_HANDLE(radv_device, device, _device);
        uint64_t abs_timeout = radv_get_absolute_timeout(timeout);
@@ -5782,8 +5991,8 @@ radv_WaitSemaphoresKHR(VkDevice _device,
 }
 
 VkResult
-radv_SignalSemaphoreKHR(VkDevice _device,
-                        const VkSemaphoreSignalInfoKHR* pSignalInfo)
+radv_SignalSemaphore(VkDevice _device,
+                     const VkSemaphoreSignalInfo* pSignalInfo)
 {
        RADV_FROM_HANDLE(radv_device, device, _device);
        RADV_FROM_HANDLE(radv_semaphore, semaphore, pSignalInfo->semaphore);
@@ -5948,23 +6157,23 @@ void radv_DestroyBuffer(
        vk_free2(&device->alloc, pAllocator, buffer);
 }
 
-VkDeviceAddress radv_GetBufferDeviceAddressKHR(
+VkDeviceAddress radv_GetBufferDeviceAddress(
        VkDevice                                    device,
-       const VkBufferDeviceAddressInfoKHR*         pInfo)
+       const VkBufferDeviceAddressInfo*         pInfo)
 {
        RADV_FROM_HANDLE(radv_buffer, buffer, pInfo->buffer);
        return radv_buffer_get_va(buffer->bo) + buffer->offset;
 }
 
 
-uint64_t radv_GetBufferOpaqueCaptureAddressKHR(VkDevice device,
-                                              const VkBufferDeviceAddressInfoKHR* pInfo)
+uint64_t radv_GetBufferOpaqueCaptureAddress(VkDevice device,
+                                           const VkBufferDeviceAddressInfo* pInfo)
 {
        return 0;
 }
 
-uint64_t radv_GetDeviceMemoryOpaqueCaptureAddressKHR(VkDevice device,
-                                                    const VkDeviceMemoryOpaqueCaptureAddressInfoKHR* pInfo)
+uint64_t radv_GetDeviceMemoryOpaqueCaptureAddress(VkDevice device,
+                                                 const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo)
 {
        return 0;
 }
@@ -6498,9 +6707,9 @@ VkResult radv_CreateFramebuffer(
 {
        RADV_FROM_HANDLE(radv_device, device, _device);
        struct radv_framebuffer *framebuffer;
-       const VkFramebufferAttachmentsCreateInfoKHR *imageless_create_info =
+       const VkFramebufferAttachmentsCreateInfo *imageless_create_info =
                vk_find_struct_const(pCreateInfo->pNext,
-                       FRAMEBUFFER_ATTACHMENTS_CREATE_INFO_KHR);
+                       FRAMEBUFFER_ATTACHMENTS_CREATE_INFO);
 
        assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO);
 
@@ -6518,7 +6727,7 @@ VkResult radv_CreateFramebuffer(
        framebuffer->layers = pCreateInfo->layers;
        if (imageless_create_info) {
                for (unsigned i = 0; i < imageless_create_info->attachmentImageInfoCount; ++i) {
-                       const VkFramebufferAttachmentImageInfoKHR *attachment =
+                       const VkFramebufferAttachmentImageInfo *attachment =
                                imageless_create_info->pAttachmentImageInfos + i;
                        framebuffer->width = MIN2(framebuffer->width, attachment->width);
                        framebuffer->height = MIN2(framebuffer->height, attachment->height);
@@ -7003,7 +7212,7 @@ void radv_GetPhysicalDeviceExternalSemaphoreProperties(
        RADV_FROM_HANDLE(radv_physical_device, pdevice, physicalDevice);
        VkSemaphoreTypeKHR type = radv_get_semaphore_type(pExternalSemaphoreInfo->pNext, NULL);
        
-       if (type == VK_SEMAPHORE_TYPE_TIMELINE_KHR) {
+       if (type == VK_SEMAPHORE_TYPE_TIMELINE) {
                pExternalSemaphoreProperties->exportFromImportedHandleTypes = 0;
                pExternalSemaphoreProperties->compatibleHandleTypes = 0;
                pExternalSemaphoreProperties->externalSemaphoreFeatures = 0;