@@ -643,11 +643,26 @@ HRESULT vkd3d_set_private_data_interface(struct vkd3d_private_store *store,
643
643
return hr ;
644
644
}
645
645
646
- HRESULT vkd3d_set_vk_object_name (struct d3d12_device * device , uint64_t vk_object ,
647
- VkDebugReportObjectTypeEXT vk_object_type , const WCHAR * name )
646
+ VkResult vkd3d_set_vk_object_name_utf8 (struct d3d12_device * device , uint64_t vk_object ,
647
+ VkDebugReportObjectTypeEXT vk_object_type , const char * name )
648
648
{
649
649
const struct vkd3d_vk_device_procs * vk_procs = & device -> vk_procs ;
650
650
VkDebugMarkerObjectNameInfoEXT info ;
651
+
652
+ if (!device -> vk_info .EXT_debug_marker )
653
+ return VK_SUCCESS ;
654
+
655
+ info .sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT ;
656
+ info .pNext = NULL ;
657
+ info .objectType = vk_object_type ;
658
+ info .object = vk_object ;
659
+ info .pObjectName = name ;
660
+ return VK_CALL (vkDebugMarkerSetObjectNameEXT (device -> vk_device , & info ));
661
+ }
662
+
663
+ HRESULT vkd3d_set_vk_object_name (struct d3d12_device * device , uint64_t vk_object ,
664
+ VkDebugReportObjectTypeEXT vk_object_type , const WCHAR * name )
665
+ {
651
666
char * name_utf8 ;
652
667
VkResult vr ;
653
668
@@ -660,12 +675,7 @@ HRESULT vkd3d_set_vk_object_name(struct d3d12_device *device, uint64_t vk_object
660
675
if (!(name_utf8 = vkd3d_strdup_w_utf8 (name , device -> wchar_size )))
661
676
return E_OUTOFMEMORY ;
662
677
663
- info .sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT ;
664
- info .pNext = NULL ;
665
- info .objectType = vk_object_type ;
666
- info .object = vk_object ;
667
- info .pObjectName = name_utf8 ;
668
- vr = VK_CALL (vkDebugMarkerSetObjectNameEXT (device -> vk_device , & info ));
678
+ vr = vkd3d_set_vk_object_name_utf8 (device , vk_object , vk_object_type , name_utf8 );
669
679
670
680
vkd3d_free (name_utf8 );
671
681
0 commit comments