mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 21:40:31 +00:00
winex11.drv: Avoid adding duplicate GPUs.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
This commit is contained in:
parent
c2a455a20d
commit
0d5c6d55bf
|
@ -633,7 +633,8 @@ static BOOL is_crtc_primary( RECT primary, const XRRCrtcInfo *crtc )
|
|||
|
||||
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDisplayKHR)
|
||||
|
||||
static BOOL get_gpu_properties_from_vulkan( struct gdi_gpu *gpu, const XRRProviderInfo *provider_info )
|
||||
static BOOL get_gpu_properties_from_vulkan( struct gdi_gpu *gpu, const XRRProviderInfo *provider_info,
|
||||
struct gdi_gpu *prev_gpus, int prev_gpu_count )
|
||||
{
|
||||
static const char *extensions[] =
|
||||
{
|
||||
|
@ -648,7 +649,7 @@ static BOOL get_gpu_properties_from_vulkan( struct gdi_gpu *gpu, const XRRProvid
|
|||
VkResult (*pvkGetRandROutputDisplayEXT)( VkPhysicalDevice, Display *, RROutput, VkDisplayKHR * );
|
||||
PFN_vkGetPhysicalDeviceProperties2KHR pvkGetPhysicalDeviceProperties2KHR;
|
||||
PFN_vkEnumeratePhysicalDevices pvkEnumeratePhysicalDevices;
|
||||
uint32_t device_count, device_idx, output_idx;
|
||||
uint32_t device_count, device_idx, output_idx, i;
|
||||
VkPhysicalDevice *vk_physical_devices = NULL;
|
||||
VkPhysicalDeviceProperties2 properties2;
|
||||
VkInstanceCreateInfo create_info;
|
||||
|
@ -703,6 +704,8 @@ static BOOL get_gpu_properties_from_vulkan( struct gdi_gpu *gpu, const XRRProvid
|
|||
goto done;
|
||||
}
|
||||
|
||||
TRACE("provider name %s.\n", debugstr_a(provider_info->name));
|
||||
|
||||
for (device_idx = 0; device_idx < device_count; ++device_idx)
|
||||
{
|
||||
for (output_idx = 0; output_idx < provider_info->noutputs; ++output_idx)
|
||||
|
@ -720,7 +723,19 @@ static BOOL get_gpu_properties_from_vulkan( struct gdi_gpu *gpu, const XRRProvid
|
|||
properties2.pNext = &id;
|
||||
|
||||
pvkGetPhysicalDeviceProperties2KHR( vk_physical_devices[device_idx], &properties2 );
|
||||
for (i = 0; i < prev_gpu_count; ++i)
|
||||
{
|
||||
if (!memcmp( &prev_gpus[i].vulkan_uuid, &id.deviceUUID, sizeof(id.deviceUUID) ))
|
||||
{
|
||||
WARN( "device UUID %#x:%#x already assigned to GPU %u.\n", *((uint32_t *)id.deviceUUID + 1),
|
||||
*(uint32_t *)id.deviceUUID, i );
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i < prev_gpu_count) continue;
|
||||
|
||||
memcpy( &gpu->vulkan_uuid, id.deviceUUID, sizeof(id.deviceUUID) );
|
||||
|
||||
/* Ignore Khronos vendor IDs */
|
||||
if (properties2.properties.vendorID < 0x10000)
|
||||
{
|
||||
|
@ -808,7 +823,7 @@ static BOOL xrandr14_get_gpus2( struct gdi_gpu **new_gpus, int *count, BOOL get_
|
|||
gpus[i].id = provider_resources->providers[i];
|
||||
if (get_properties)
|
||||
{
|
||||
if (!get_gpu_properties_from_vulkan( &gpus[i], provider_info ))
|
||||
if (!get_gpu_properties_from_vulkan( &gpus[i], provider_info, gpus, i ))
|
||||
RtlUTF8ToUnicodeN( gpus[i].name, sizeof(gpus[i].name), &len, provider_info->name,
|
||||
strlen( provider_info->name ) + 1 );
|
||||
/* FIXME: Add an alternate method of getting PCI IDs, for systems that don't support Vulkan */
|
||||
|
|
Loading…
Reference in a new issue