vkd3d: Return a null handle from GetGPUDescriptorHandleForHeapStart() for non-shader-visible heaps.

This commit is contained in:
Conor McCarthy 2023-07-10 15:28:20 +10:00 committed by Alexandre Julliard
parent 981034e6e4
commit 9014183100
Notes: Alexandre Julliard 2023-07-20 22:58:27 +02:00
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/272
2 changed files with 9 additions and 2 deletions

View File

@ -3859,7 +3859,15 @@ static D3D12_GPU_DESCRIPTOR_HANDLE * STDMETHODCALLTYPE d3d12_descriptor_heap_Get
TRACE("iface %p, descriptor %p.\n", iface, descriptor);
descriptor->ptr = (uint64_t)(intptr_t)heap->descriptors;
if (heap->desc.Flags & D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE)
{
descriptor->ptr = (uint64_t)(intptr_t)heap->descriptors;
}
else
{
WARN("Heap %p is not shader-visible.\n", iface);
descriptor->ptr = 0;
}
return descriptor;
}

View File

@ -2372,7 +2372,6 @@ static void test_create_descriptor_heap(void)
ok(hr == S_OK, "Failed to create descriptor heap, hr %#x.\n", hr);
gpu_handle = ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart(heap);
todo
ok(!gpu_handle.ptr, "Got unexpected ptr %"PRIx64".\n", gpu_handle.ptr);
refcount = get_refcount(device);