mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d: Set Vulkan object names for NULL CBV resources.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
f91422eb40
commit
085456005c
@ -2895,6 +2895,7 @@ HRESULT vkd3d_init_null_resources(struct vkd3d_null_resources *null_resources,
|
||||
{
|
||||
D3D12_HEAP_PROPERTIES heap_properties;
|
||||
D3D12_RESOURCE_DESC buffer_desc;
|
||||
VkResult vr;
|
||||
HRESULT hr;
|
||||
|
||||
memset(null_resources, 0, sizeof(*null_resources));
|
||||
@ -2918,10 +2919,18 @@ HRESULT vkd3d_init_null_resources(struct vkd3d_null_resources *null_resources,
|
||||
&buffer_desc, &null_resources->vk_uniform_buffer)))
|
||||
goto fail;
|
||||
|
||||
if ((vr = vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_uniform_buffer,
|
||||
VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, "NULL CBV buffer")) < 0)
|
||||
WARN("Failed to set object name, vr %d.\n", vr);
|
||||
|
||||
if (FAILED(hr = vkd3d_allocate_buffer_memory(device, null_resources->vk_uniform_buffer,
|
||||
&heap_properties, D3D12_HEAP_FLAG_NONE, &null_resources->vk_uniform_buffer_memory)))
|
||||
goto fail;
|
||||
|
||||
if ((vr = vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_uniform_buffer_memory,
|
||||
VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, "NULL CBV memory")) < 0)
|
||||
WARN("Failed to set object name, vr %d.\n", vr);
|
||||
|
||||
return S_OK;
|
||||
|
||||
fail:
|
||||
|
@ -643,11 +643,26 @@ HRESULT vkd3d_set_private_data_interface(struct vkd3d_private_store *store,
|
||||
return hr;
|
||||
}
|
||||
|
||||
HRESULT vkd3d_set_vk_object_name(struct d3d12_device *device, uint64_t vk_object,
|
||||
VkDebugReportObjectTypeEXT vk_object_type, const WCHAR *name)
|
||||
VkResult vkd3d_set_vk_object_name_utf8(struct d3d12_device *device, uint64_t vk_object,
|
||||
VkDebugReportObjectTypeEXT vk_object_type, const char *name)
|
||||
{
|
||||
const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs;
|
||||
VkDebugMarkerObjectNameInfoEXT info;
|
||||
|
||||
if (!device->vk_info.EXT_debug_marker)
|
||||
return VK_SUCCESS;
|
||||
|
||||
info.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT;
|
||||
info.pNext = NULL;
|
||||
info.objectType = vk_object_type;
|
||||
info.object = vk_object;
|
||||
info.pObjectName = name;
|
||||
return VK_CALL(vkDebugMarkerSetObjectNameEXT(device->vk_device, &info));
|
||||
}
|
||||
|
||||
HRESULT vkd3d_set_vk_object_name(struct d3d12_device *device, uint64_t vk_object,
|
||||
VkDebugReportObjectTypeEXT vk_object_type, const WCHAR *name)
|
||||
{
|
||||
char *name_utf8;
|
||||
VkResult vr;
|
||||
|
||||
@ -660,12 +675,7 @@ HRESULT vkd3d_set_vk_object_name(struct d3d12_device *device, uint64_t vk_object
|
||||
if (!(name_utf8 = vkd3d_strdup_w_utf8(name, device->wchar_size)))
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
info.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT;
|
||||
info.pNext = NULL;
|
||||
info.objectType = vk_object_type;
|
||||
info.object = vk_object;
|
||||
info.pObjectName = name_utf8;
|
||||
vr = VK_CALL(vkDebugMarkerSetObjectNameEXT(device->vk_device, &info));
|
||||
vr = vkd3d_set_vk_object_name_utf8(device, vk_object, vk_object_type, name_utf8);
|
||||
|
||||
vkd3d_free(name_utf8);
|
||||
|
||||
|
@ -1043,6 +1043,8 @@ static inline void vkd3d_set_thread_name(const char *name)
|
||||
#endif
|
||||
}
|
||||
|
||||
VkResult vkd3d_set_vk_object_name_utf8(struct d3d12_device *device, uint64_t vk_object,
|
||||
VkDebugReportObjectTypeEXT vk_object_type, const char *name) DECLSPEC_HIDDEN;
|
||||
HRESULT vkd3d_set_vk_object_name(struct d3d12_device *device, uint64_t vk_object,
|
||||
VkDebugReportObjectTypeEXT vk_object_type, const WCHAR *name) DECLSPEC_HIDDEN;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user