diff --git a/runtime/shims/d3d12_vulkan_device.cpp b/runtime/shims/d3d12_vulkan_device.cpp index de623b6040..4a20e66d76 100644 --- a/runtime/shims/d3d12_vulkan_device.cpp +++ b/runtime/shims/d3d12_vulkan_device.cpp @@ -2892,6 +2892,18 @@ struct DeviceState { }()}; std::atomic next_checkpoint{GetTickCount64() + 120000}; std::atomic active_compiles{0}; + // vkSetDebugUtilsObjectNameEXT when the instance enabled VK_EXT_debug_utils, else null. Compute pipelines carry + // their shader's name, so a crash-diagnostic dump or a capture names the dispatch that faulted. + PFN_vkSetDebugUtilsObjectNameEXT set_object_name = nullptr; + + void name_object(VkObjectType type, std::uint64_t handle, const char* name) const { + if (!set_object_name || !handle || !name || !*name) return; + VkDebugUtilsObjectNameInfoEXT info{VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT}; + info.objectType = type; + info.objectHandle = handle; + info.pObjectName = name; + set_object_name(this->info.device, &info); + } VkPipelineCache pipeline_cache() { std::call_once(pipeline_cache_once, [this] { @@ -11950,6 +11962,9 @@ ComputeBuild build_compute_pipeline(DeviceState& device, const leonida::ShaderEn static_cast(probe_ms)); if (from_shared) journal.found_in_shared(); journal.publish(); + if (created == VK_SUCCESS && built) + device.name_object(VK_OBJECT_TYPE_PIPELINE, std::uint64_t(reinterpret_cast(built)), + entry->name.c_str()); out.pipeline = built; out.result = created; out.from_shared = from_shared; @@ -15654,6 +15669,7 @@ class Device final load(labels.queue_begin, "vkQueueBeginDebugUtilsLabelEXT"); load(labels.queue_end, "vkQueueEndDebugUtilsLabelEXT"); state_.context->enable_debug_labels(labels); + load(state_.set_object_name, "vkSetDebugUtilsObjectNameEXT"); if (!state_.context->debug_labels()) std::fprintf(stderr, "[rt] d3d12: VK_EXT_debug_utils entry points missing; debug markers are off\n"); }