mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d: Always pass null heap properties to vkd3d_create_image() for sparse images.
This commit is contained in:
parent
9532ac5f84
commit
e93f2e7746
Notes:
Alexandre Julliard
2023-06-27 23:33:57 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/216
@ -943,6 +943,7 @@ HRESULT vkd3d_get_image_allocation_info(struct d3d12_device *device,
|
||||
D3D12_RESOURCE_DESC validated_desc;
|
||||
VkMemoryRequirements requirements;
|
||||
VkImage vk_image;
|
||||
bool tiled;
|
||||
HRESULT hr;
|
||||
|
||||
assert(desc->Dimension != D3D12_RESOURCE_DIMENSION_BUFFER);
|
||||
@ -955,8 +956,10 @@ HRESULT vkd3d_get_image_allocation_info(struct d3d12_device *device,
|
||||
desc = &validated_desc;
|
||||
}
|
||||
|
||||
tiled = desc->Layout == D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE;
|
||||
|
||||
/* XXX: We have to create an image to get its memory requirements. */
|
||||
if (SUCCEEDED(hr = vkd3d_create_image(device, &heap_properties, 0, desc, NULL, &vk_image)))
|
||||
if (SUCCEEDED(hr = vkd3d_create_image(device, tiled ? NULL : &heap_properties, 0, desc, NULL, &vk_image)))
|
||||
{
|
||||
VK_CALL(vkGetImageMemoryRequirements(device->vk_device, vk_image, &requirements));
|
||||
VK_CALL(vkDestroyImage(device->vk_device, vk_image, NULL));
|
||||
|
Loading…
Reference in New Issue
Block a user