radv: init the trace BO before compiling meta shaders
[mesa.git] / src / amd / vulkan / radv_device.c
index 2067685c5ab4a600ae6d259d180fde6ab5ecd006..28a941e219c3c1b11a1c5e2d9d04271f8b54c3cd 100644 (file)
@@ -179,6 +179,14 @@ static const VkExtensionProperties common_device_extensions[] = {
                .specVersion = 1,
        },
 };
+
+static const VkExtensionProperties rasterization_order_extension[] ={
+       {
+               .extensionName = VK_AMD_RASTERIZATION_ORDER_EXTENSION_NAME,
+               .specVersion = 1,
+       },
+};
+
 static const VkExtensionProperties ext_sema_device_extensions[] = {
        {
                .extensionName = VK_KHR_EXTERNAL_SEMAPHORE_EXTENSION_NAME,
@@ -343,6 +351,15 @@ radv_physical_device_init(struct radv_physical_device *device,
        if (result != VK_SUCCESS)
                goto fail;
 
+       if (device->rad_info.chip_class >= VI && device->rad_info.max_se >= 2) {
+               result = radv_extensions_register(instance,
+                                               &device->extensions,
+                                               rasterization_order_extension,
+                                               ARRAY_SIZE(rasterization_order_extension));
+               if (result != VK_SUCCESS)
+                       goto fail;
+       }
+
        if (device->rad_info.has_syncobj) {
                result = radv_extensions_register(instance,
                                                  &device->extensions,
@@ -547,7 +564,7 @@ radv_enumerate_devices(struct radv_instance *instance)
        for (unsigned i = 0; i < (unsigned)max_devices; i++) {
                if (devices[i]->available_nodes & 1 << DRM_NODE_RENDER &&
                    devices[i]->bustype == DRM_BUS_PCI &&
-                   devices[i]->deviceinfo.pci->vendor_id == 0x1002) {
+                   devices[i]->deviceinfo.pci->vendor_id == ATI_VENDOR_ID) {
 
                        result = radv_physical_device_init(instance->physicalDevices +
                                                           instance->physicalDeviceCount,
@@ -810,7 +827,7 @@ void radv_GetPhysicalDeviceProperties(
        *pProperties = (VkPhysicalDeviceProperties) {
                .apiVersion = VK_MAKE_VERSION(1, 0, 42),
                .driverVersion = vk_get_driver_version(),
-               .vendorID = 0x1002,
+               .vendorID = ATI_VENDOR_ID,
                .deviceID = pdevice->rad_info.pci_id,
                .deviceType = pdevice->rad_info.has_dedicated_vram ? VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU : VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU,
                .limits = limits,
@@ -1186,6 +1203,11 @@ VkResult radv_CreateDevice(
                device->physical_device->rad_info.chip_class >= VI &&
                device->physical_device->rad_info.max_se >= 2;
 
+       if (getenv("RADV_TRACE_FILE")) {
+               if (!radv_init_trace(device))
+                       goto fail;
+       }
+
        result = radv_device_init_meta(device);
        if (result != VK_SUCCESS)
                goto fail;
@@ -1208,11 +1230,6 @@ VkResult radv_CreateDevice(
                device->ws->cs_finalize(device->empty_cs[family]);
        }
 
-       if (getenv("RADV_TRACE_FILE")) {
-               if (!radv_init_trace(device))
-                       goto fail;
-       }
-
        if (device->physical_device->rad_info.chip_class >= CIK)
                cik_create_gfx_config(device);