A bunch of fixes and improvements related to Vulkan GPUs in win32u.
The first commit fixes a bug with enumeration of multiple GPUs, the next two are supposed to improve logging, the last one gets rid of unused variable.
This merge request was approved by Rémi Bernon.
From: Krzysztof Bogacki krzysztof.bogacki@leancode.pl
Signed-off-by: Krzysztof Bogacki krzysztof.bogacki@leancode.pl --- dlls/win32u/d3dkmt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/win32u/d3dkmt.c b/dlls/win32u/d3dkmt.c index b644135bfa1..5f3804c165d 100644 --- a/dlls/win32u/d3dkmt.c +++ b/dlls/win32u/d3dkmt.c @@ -563,7 +563,7 @@ NTSTATUS WINAPI NtGdiDdDDICheckVidPnExclusiveOwnership( const D3DKMT_CHECKVIDPNE BOOL get_vulkan_gpus( struct list *gpus ) { VkPhysicalDevice *devices; - UINT i, count; + UINT i, j, count;
if (!d3dkmt_use_vulkan()) return FALSE; if (!(count = get_vulkan_physical_devices( &devices ))) return FALSE; @@ -583,10 +583,10 @@ BOOL get_vulkan_gpus( struct list *gpus ) gpu->pci_id.device = properties2.properties.deviceID;
pvkGetPhysicalDeviceMemoryProperties( devices[i], &mem_properties ); - for (i = 0; i < mem_properties.memoryHeapCount; i++) + for (j = 0; j < mem_properties.memoryHeapCount; j++) { - if (mem_properties.memoryHeaps[i].flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) - gpu->memory += mem_properties.memoryHeaps[i].size; + if (mem_properties.memoryHeaps[j].flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) + gpu->memory += mem_properties.memoryHeaps[j].size; }
list_add_tail( gpus, &gpu->entry );
From: Krzysztof Bogacki krzysztof.bogacki@leancode.pl
We already have input GPU's PCI IDs logged by TRACE above; logging Vulkan GPU's IDs the second time is a bit inconsistent and misleading.
Signed-off-by: Krzysztof Bogacki krzysztof.bogacki@leancode.pl --- dlls/win32u/sysparams.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 54f514f557e..9d765545d26 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1235,14 +1235,16 @@ static void add_gpu( const char *name, const struct pci_id *pci_id, const GUID *
if ((vulkan_gpu = find_vulkan_gpu_from_uuid( ctx, vulkan_uuid ))) TRACE( "Found vulkan GPU matching uuid %s, pci_id %#04x:%#04x, name %s\n", debugstr_guid(&vulkan_gpu->uuid), - pci_id->vendor, pci_id->device, debugstr_a(vulkan_gpu->name)); + vulkan_gpu->pci_id.vendor, vulkan_gpu->pci_id.device, debugstr_a(vulkan_gpu->name)); else if ((vulkan_gpu = find_vulkan_gpu_from_pci_id( ctx, pci_id ))) - TRACE( "Found vulkan GPU matching pci_id %#04x:%#04x, uuid %s, name %s\n", pci_id->vendor, pci_id->device, + TRACE( "Found vulkan GPU matching pci_id %#04x:%#04x, uuid %s, name %s\n", + vulkan_gpu->pci_id.vendor, vulkan_gpu->pci_id.device, debugstr_guid(&vulkan_gpu->uuid), debugstr_a(vulkan_gpu->name)); else if ((ptr = list_head( &ctx->vulkan_gpus ))) { vulkan_gpu = LIST_ENTRY( ptr, struct vulkan_gpu, entry ); - WARN( "Using vulkan GPU pci_id %#04x:%#04x, uuid %s, name %s\n", pci_id->vendor, pci_id->device, + WARN( "Using vulkan GPU pci_id %#04x:%#04x, uuid %s, name %s\n", + vulkan_gpu->pci_id.vendor, vulkan_gpu->pci_id.device, debugstr_guid(&vulkan_gpu->uuid), debugstr_a(vulkan_gpu->name)); }
From: Krzysztof Bogacki krzysztof.bogacki@leancode.pl
Signed-off-by: Krzysztof Bogacki krzysztof.bogacki@leancode.pl --- dlls/win32u/sysparams.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 3a22d8c73db..26ed8b1d1ac 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1996,7 +1996,6 @@ static UINT update_display_devices( struct device_manager_ctx *ctx )
static void add_vulkan_only_gpus( struct device_manager_ctx *ctx ) { - struct list gpus = LIST_INIT(gpus); struct vulkan_gpu *gpu, *next;
LIST_FOR_EACH_ENTRY_SAFE( gpu, next, &ctx->vulkan_gpus, struct vulkan_gpu, entry )
From: Krzysztof Bogacki krzysztof.bogacki@leancode.pl
Signed-off-by: Krzysztof Bogacki krzysztof.bogacki@leancode.pl --- dlls/win32u/sysparams.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 9d765545d26..3a22d8c73db 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1217,8 +1217,8 @@ static void add_gpu( const char *name, const struct pci_id *pci_id, const GUID * HKEY hkey, subkey; DWORD len;
- TRACE( "%s %04X %04X %08X %02X\n", debugstr_a( name ), pci_id->vendor, pci_id->device, - pci_id->subsystem, pci_id->revision ); + TRACE( "%s %04X %04X %08X %02X %s\n", debugstr_a( name ), pci_id->vendor, pci_id->device, + pci_id->subsystem, pci_id->revision, debugstr_guid( vulkan_uuid ) );
if (!enum_key && !(enum_key = reg_create_ascii_key( NULL, enum_keyA, 0, NULL ))) return;