Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- libs/vkd3d/resource.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index 626772e..ddd8bfc 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -58,9 +58,19 @@ static unsigned int vkd3d_select_memory_type(struct d3d12_device *device, uint32 break;
case D3D12_HEAP_TYPE_CUSTOM: - FIXME("Custom heaps not supported yet.\n"); - flags[count++] = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT - | VK_MEMORY_PROPERTY_HOST_CACHED_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; + switch (heap_properties->CPUPageProperty) + { + case D3D12_CPU_PAGE_PROPERTY_WRITE_COMBINE: + flags[count++] = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; + break; + default: + WARN("Invalid CPU page property.\n"); + /* Fall through. */ + case D3D12_CPU_PAGE_PROPERTY_WRITE_BACK: + flags[count++] = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT + | VK_MEMORY_PROPERTY_HOST_CACHED_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; + break; + } flags[count++] = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; flags[count++] = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; break;