Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions runtime/shims/d3d12_vulkan_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2892,6 +2892,18 @@ struct DeviceState {
}()};
std::atomic<ULONGLONG> next_checkpoint{GetTickCount64() + 120000};
std::atomic<unsigned> 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] {
Expand Down Expand Up @@ -11950,6 +11962,9 @@ ComputeBuild build_compute_pipeline(DeviceState& device, const leonida::ShaderEn
static_cast<unsigned long long>(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<std::uintptr_t>(built)),
entry->name.c_str());
out.pipeline = built;
out.result = created;
out.from_shared = from_shared;
Expand Down Expand Up @@ -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");
}
Expand Down