tu: support driconf option force_vk_vendor

Some games refuse to start with an unknown (to them) GPU vendor. Enable
the usual way to override the vendor ID in this driver.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38795>
This commit is contained in:
Val Packett 2025-12-01 00:49:16 -03:00 committed by Marge Bot
parent c0e6b0aca0
commit e9ad86db08
2 changed files with 6 additions and 1 deletions

View file

@ -1177,7 +1177,8 @@ tu_get_properties(struct tu_physical_device *pdevice,
VK_MAKE_VERSION(1, 3, VK_HEADER_VERSION))
: VK_MAKE_VERSION(1, 0, VK_HEADER_VERSION);
props->driverVersion = vk_get_driver_version();
props->vendorID = 0x5143;
props->vendorID = pdevice->instance->force_vk_vendor != 0 ?
pdevice->instance->force_vk_vendor : 0x5143;
props->deviceID = pdevice->dev_id.chip_id;
props->deviceType = VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU;
@ -1770,6 +1771,7 @@ static const driOptionDescription tu_dri_options[] = {
DRI_CONF_SECTION_END
DRI_CONF_SECTION_DEBUG
DRI_CONF_FORCE_VK_VENDOR()
DRI_CONF_VK_WSI_FORCE_BGRA8_UNORM_FIRST(false)
DRI_CONF_VK_WSI_FORCE_SWAPCHAIN_TO_CURRENT_EXTENT(false)
DRI_CONF_VK_X11_IGNORE_SUBOPTIMAL(false)
@ -1796,6 +1798,8 @@ tu_init_dri_options(struct tu_instance *instance)
instance->vk.app_info.app_name, instance->vk.app_info.app_version,
instance->vk.app_info.engine_name, instance->vk.app_info.engine_version);
instance->force_vk_vendor =
driQueryOptioni(&instance->dri_options, "force_vk_vendor");
instance->dont_care_as_load =
driQueryOptionb(&instance->dri_options, "vk_dont_care_as_load");
instance->conservative_lrz =

View file

@ -189,6 +189,7 @@ struct tu_instance
struct driOptionCache dri_options;
struct driOptionCache available_dri_options;
uint32_t force_vk_vendor;
bool dont_care_as_load;
/* Conservative LRZ (default true) invalidates LRZ on draws with