mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d: Allocate device memory when heap offset is misaligned.
On radv with AMD Polaris GPUs, the alignment may be as high as 0x20000 or 0x40000. World of Warcraft seems to ignore the alignment returned from GetResourceAllocationInfo(), and simply aligns to 0x10000 (D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT). Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
a4c18e83e3
commit
be23a8fc90
@ -1492,7 +1492,7 @@ HRESULT d3d12_committed_resource_create(struct d3d12_device *device,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT vkd3d_bind_heap_memory(struct d3d12_device *device,
|
static HRESULT vkd3d_bind_heap_memory(struct d3d12_device *device,
|
||||||
struct d3d12_resource *resource, struct d3d12_heap *heap, UINT64 heap_offset)
|
struct d3d12_resource *resource, struct d3d12_heap *heap, uint64_t heap_offset)
|
||||||
{
|
{
|
||||||
const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs;
|
const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs;
|
||||||
VkDevice vk_device = device->vk_device;
|
VkDevice vk_device = device->vk_device;
|
||||||
@ -1506,16 +1506,16 @@ static HRESULT vkd3d_bind_heap_memory(struct d3d12_device *device,
|
|||||||
|
|
||||||
if (heap_offset % requirements.alignment)
|
if (heap_offset % requirements.alignment)
|
||||||
{
|
{
|
||||||
FIXME("Invalid heap offset %#"PRIx64".\n", heap_offset);
|
FIXME("Invalid heap offset %#"PRIx64" (alignment %#"PRIx64").\n",
|
||||||
return E_INVALIDARG;
|
heap_offset, requirements.alignment);
|
||||||
|
goto allocate_memory;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(requirements.memoryTypeBits & (1u << heap->vk_memory_type)))
|
if (!(requirements.memoryTypeBits & (1u << heap->vk_memory_type)))
|
||||||
{
|
{
|
||||||
FIXME("Memory type %u cannot be bound to resource %p (allowed types %#x), "
|
FIXME("Memory type %u cannot be bound to resource %p (allowed types %#x).\n",
|
||||||
"allocating device memory.\n",
|
|
||||||
heap->vk_memory_type, resource, requirements.memoryTypeBits);
|
heap->vk_memory_type, resource, requirements.memoryTypeBits);
|
||||||
return vkd3d_allocate_resource_memory(device, resource, &heap->desc.Properties, heap->desc.Flags);
|
goto allocate_memory;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (d3d12_resource_is_buffer(resource))
|
if (d3d12_resource_is_buffer(resource))
|
||||||
@ -1534,6 +1534,10 @@ static HRESULT vkd3d_bind_heap_memory(struct d3d12_device *device,
|
|||||||
}
|
}
|
||||||
|
|
||||||
return hresult_from_vk_result(vr);
|
return hresult_from_vk_result(vr);
|
||||||
|
|
||||||
|
allocate_memory:
|
||||||
|
FIXME("Allocating device memory.\n");
|
||||||
|
return vkd3d_allocate_resource_memory(device, resource, &heap->desc.Properties, heap->desc.Flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT d3d12_placed_resource_create(struct d3d12_device *device, struct d3d12_heap *heap, UINT64 heap_offset,
|
HRESULT d3d12_placed_resource_create(struct d3d12_device *device, struct d3d12_heap *heap, UINT64 heap_offset,
|
||||||
|
Loading…
Reference in New Issue
Block a user