Hitman 2 calls GetHeapProperties() for each swapchain buffer and checks if the creation node mask is 1. If not then it fails to store the resource pointers for later rendering.
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- Supersedes 173580. --- libs/vkd3d/resource.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index 256c0b9..c5f55fd 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -1534,6 +1534,8 @@ static HRESULT STDMETHODCALLTYPE d3d12_resource_GetHeapProperties(ID3D12Resource { memset(heap_properties, 0, sizeof(*heap_properties)); heap_properties->Type = D3D12_HEAP_TYPE_DEFAULT; + heap_properties->CreationNodeMask = 1; + heap_properties->VisibleNodeMask = 1; } if (flags) *flags = D3D12_HEAP_FLAG_NONE;
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- tests/vkd3d_api.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/tests/vkd3d_api.c b/tests/vkd3d_api.c index a9a7fc1..ba13d66 100644 --- a/tests/vkd3d_api.c +++ b/tests/vkd3d_api.c @@ -854,7 +854,9 @@ static VkDeviceMemory allocate_vulkan_image_memory(ID3D12Device *device, static void test_external_resource_map(void) { struct vkd3d_image_resource_create_info resource_create_info; + D3D12_HEAP_PROPERTIES heap_properties; D3D12_GPU_VIRTUAL_ADDRESS gpu_address; + D3D12_HEAP_FLAGS heap_flags; ID3D12Resource *vk_resource; VkDeviceMemory vk_memory; ID3D12Device *device; @@ -898,6 +900,14 @@ static void test_external_resource_map(void) gpu_address = ID3D12Resource_GetGPUVirtualAddress(vk_resource); ok(!gpu_address, "Got unexpected GPU virtual address %#"PRIx64".\n", gpu_address);
+ hr = ID3D12Resource_GetHeapProperties(vk_resource, &heap_properties, &heap_flags); + ok(hr == S_OK, "Failed to get heap properties, hr %#x.\n", hr); + ok(heap_properties.Type == D3D12_HEAP_TYPE_DEFAULT, "Got unexpected heap type 0x%x.\n", heap_properties.Type); + ok(heap_properties.CPUPageProperty == 0, "Got unexpected cpu page property 0x%x.\n", heap_properties.CPUPageProperty); + ok(heap_properties.MemoryPoolPreference == 0, "Got unexpected memory pool preference 0x%x.\n", heap_properties.MemoryPoolPreference); + ok(heap_properties.CreationNodeMask != 0, "Got unexpected node mask 0x%x.\n", heap_properties.CreationNodeMask); + ok(heap_properties.VisibleNodeMask != 0, "Got unexpected node mask 0x%x.\n", heap_properties.VisibleNodeMask); + ID3D12Resource_Release(vk_resource); vk_device = vkd3d_get_vk_device(device); vkDestroyImage(vk_device, vk_image, NULL);