Skip to content

Commit

Permalink
Attempt fix video ValveSoftware#2
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Doron <[email protected]>
  • Loading branch information
arilou committed Nov 21, 2023
1 parent cb64aa8 commit e1bf45e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
3 changes: 1 addition & 2 deletions dlls/win32u/sysparams.c
Original file line number Diff line number Diff line change
Expand Up @@ -1077,8 +1077,7 @@ static void add_gpu( const struct gdi_gpu *gpu, void *param )
set_reg_value( hkey, bios_stringW, REG_BINARY, desc, size );
set_reg_value( hkey, chip_typeW, REG_BINARY, desc, size );
set_reg_value( hkey, dac_typeW, REG_BINARY, ramdacW, sizeof(ramdacW) );
unsigned __int64 memory_size = 4294967296LL;
set_reg_value( hkey, memory_sizeW, REG_BINARY, &memory_size, sizeof(memory_size) );
set_reg_value( hkey, memory_sizeW, REG_BINARY, &gpu->memory_size, sizeof(gpu->memory_size) );

NtClose( hkey );

Expand Down
15 changes: 14 additions & 1 deletion dlls/winex11.drv/xrandr.c
Original file line number Diff line number Diff line change
Expand Up @@ -744,13 +744,15 @@ static void add_remaining_gpus_via_vulkan( struct gdi_gpu **gpus, int *count )
const struct vulkan_funcs *vulkan_funcs = get_vulkan_driver( WINE_VULKAN_DRIVER_VERSION );
PFN_vkGetPhysicalDeviceProperties2KHR pvkGetPhysicalDeviceProperties2KHR;
PFN_vkEnumeratePhysicalDevices pvkEnumeratePhysicalDevices;
PFN_vkGetPhysicalDeviceMemoryProperties pvkGetPhysicalDeviceMemoryProperties;
uint32_t device_count;
VkPhysicalDevice *vk_physical_devices = NULL;
VkPhysicalDeviceProperties2 properties2;
VkPhysicalDeviceMemoryProperties mem_properties;
VkInstanceCreateInfo create_info;
VkPhysicalDeviceIDProperties id;
VkInstance vk_instance = NULL;
INT gpu_idx, device_idx;
INT gpu_idx, device_idx, heap_idx;
INT original_gpu_count = *count;
struct gdi_gpu *new_gpu;
BOOL new;
Expand All @@ -777,6 +779,7 @@ static void add_remaining_gpus_via_vulkan( struct gdi_gpu **gpus, int *count )

LOAD_VK_FUNC(vkEnumeratePhysicalDevices)
LOAD_VK_FUNC(vkGetPhysicalDeviceProperties2KHR)
LOAD_VK_FUNC(vkGetPhysicalDeviceMemoryProperties)
#undef LOAD_VK_FUNC

vr = pvkEnumeratePhysicalDevices( vk_instance, &device_count, NULL );
Expand Down Expand Up @@ -833,6 +836,16 @@ static void add_remaining_gpus_via_vulkan( struct gdi_gpu **gpus, int *count )
new_gpu->device_id = properties2.properties.deviceID;
MultiByteToWideChar( CP_UTF8, 0, properties2.properties.deviceName, -1, new_gpu->name, ARRAY_SIZE(new_gpu->name) );

pvkGetPhysicalDeviceMemoryProperties(vk_physical_devices[device_idx], &mem_properties);
for (heap_idx = 0; heap_idx < mem_properties.memoryHeapCount; heap_idx++)
{
if (mem_properties.memoryHeaps[heap_idx].flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT)
{
new_gpu->memory_size = mem_properties.memoryHeaps[heap_idx].size;
break;
}
}

TRACE("Added a new GPU via Vulkan: %04x:%04x %s\n", new_gpu->vendor_id, new_gpu->device_id, debugstr_w(new_gpu->name));
}

Expand Down
1 change: 1 addition & 0 deletions include/wine/gdi_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ struct gdi_gpu
UINT subsys_id;
UINT revision_id;
GUID vulkan_uuid; /* Vulkan device UUID */
ULONGLONG memory_size;
};

struct gdi_adapter
Expand Down

0 comments on commit e1bf45e

Please sign in to comment.