Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- libs/vkd3d/resource.c | 11 +++++++++-- libs/vkd3d/vkd3d_private.h | 1 + 2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index 3f8e05e..5e47a80 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -144,6 +144,7 @@ static ULONG STDMETHODCALLTYPE d3d12_heap_Release(ID3D12Heap *iface) struct d3d12_device *device = heap->device; const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs;
+ if (heap->name) vkd3d_free(heap->name); vkd3d_private_store_destroy(&heap->private_store);
VK_CALL(vkFreeMemory(device->vk_device, heap->vk_memory, NULL)); @@ -191,10 +192,15 @@ static HRESULT STDMETHODCALLTYPE d3d12_heap_SetPrivateDataInterface(ID3D12Heap * static HRESULT STDMETHODCALLTYPE d3d12_heap_SetName(ID3D12Heap *iface, const WCHAR *name) { struct d3d12_heap *heap = impl_from_ID3D12Heap(iface); + HRESULT hr;
- FIXME("iface %p, name %s stub!\n", iface, debugstr_w(name, heap->device->wchar_size)); + TRACE("iface %p, name %s.\n", iface, debugstr_w(name, heap->device->wchar_size));
- return E_NOTIMPL; + hr = vkd3d_set_vk_object_name(heap->device, (uint64_t)heap->vk_memory, + VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, name); + if (FAILED(hr)) return hr; + + return vkd3d_set_name(&heap->name, name, heap->device->wchar_size); }
static HRESULT STDMETHODCALLTYPE d3d12_heap_GetDevice(ID3D12Heap *iface, @@ -349,6 +355,7 @@ static HRESULT d3d12_heap_init(struct d3d12_heap *heap,
heap->ID3D12Heap_iface.lpVtbl = &d3d12_heap_vtbl; heap->refcount = 1; + heap->name = NULL;
heap->desc = *desc;
diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index fbabc39..6607634 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -263,6 +263,7 @@ struct d3d12_heap { ID3D12Heap ID3D12Heap_iface; LONG refcount; + WCHAR *name;
D3D12_HEAP_DESC desc;