Signed-off-by: Derek Lesho dlesho@codeweavers.com --- v2: Use CheckFeatureSupport to adjust the results of the function based on whether UMA and CacheCoherentUMA are supported. --- libs/vkd3d/device.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-)
diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index 4d6f7c9..0e69f6a 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -2974,10 +2974,37 @@ invalid: static D3D12_HEAP_PROPERTIES * STDMETHODCALLTYPE d3d12_device_GetCustomHeapProperties(ID3D12Device *iface, D3D12_HEAP_PROPERTIES *heap_properties, UINT node_mask, D3D12_HEAP_TYPE heap_type) { - FIXME("iface %p, heap_properties %p, node_mask 0x%08x, heap_type %#x stub!\n", + D3D12_FEATURE_DATA_ARCHITECTURE data; + + TRACE("iface %p, heap_properties %p, node_mask 0x%08x, heap_type %#x\n", iface, heap_properties, node_mask, heap_type);
debug_ignored_node_mask(node_mask); + heap_properties->CreationNodeMask = 1; + heap_properties->VisibleNodeMask = 1; + heap_properties->Type = heap_type; + + d3d12_device_CheckFeatureSupport(iface, D3D12_FEATURE_ARCHITECTURE, &data, sizeof(data)); + + switch (heap_type) + { + case D3D12_HEAP_TYPE_UPLOAD: + heap_properties->CPUPageProperty = data.CacheCoherentUMA ? + D3D12_CPU_PAGE_PROPERTY_WRITE_BACK : D3D12_CPU_PAGE_PROPERTY_WRITE_COMBINE; + heap_properties->MemoryPoolPreference = D3D12_MEMORY_POOL_L0; + break; + case D3D12_HEAP_TYPE_DEFAULT: + heap_properties->CPUPageProperty = D3D12_CPU_PAGE_PROPERTY_NOT_AVAILABLE; + heap_properties->MemoryPoolPreference = data.UMA ? + D3D12_MEMORY_POOL_L0 : D3D12_MEMORY_POOL_L1; + break; + case D3D12_HEAP_TYPE_READBACK: + heap_properties->CPUPageProperty = D3D12_CPU_PAGE_PROPERTY_WRITE_BACK; + heap_properties->MemoryPoolPreference = D3D12_MEMORY_POOL_L0; + break; + default: + FIXME("Unhandled heap type: %#x\n", heap_type); + };
return heap_properties; }