diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index 7bcfa9ef62..2a2f71a1a5 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -1995,6 +1995,10 @@ if(TARGET Vulkan::Headers) add_executable(vulkan_device_markers_test test/vulkan_device_markers_test.cpp) target_link_libraries(vulkan_device_markers_test PRIVATE Vulkan::Headers) add_test(NAME vulkan_device_markers COMMAND vulkan_device_markers_test) + # The depth24 converter's scratch chunks are shared by the device's queue families, on the CPU (faked driver). + add_executable(depth24_scratch_sharing_test test/depth24_scratch_sharing_test.cpp) + target_link_libraries(depth24_scratch_sharing_test PRIVATE Vulkan::Headers) + add_test(NAME depth24_scratch_sharing COMMAND depth24_scratch_sharing_test) # The submit lock's owner tracking, waiter count, submit handoff and compile gate (SubmitMutex), on the CPU. if(WIN32) add_executable(submit_mutex_test test/submit_mutex_test.cpp) diff --git a/runtime/shims/d3d12_vulkan_device.cpp b/runtime/shims/d3d12_vulkan_device.cpp index e7980daeed..1d13a09a0c 100644 --- a/runtime/shims/d3d12_vulkan_device.cpp +++ b/runtime/shims/d3d12_vulkan_device.cpp @@ -14752,7 +14752,7 @@ class Device final if (info.device_fault_diagnostics) { state_.context->configure_device_fault(get_device, {info.device_fault_info, info.device_checkpoints, info.device_diagnostics_config, info.device_markers}, - &state_.memory); + &state_.memory, state_.families); state_.context->add_diagnostic_queue(info.queue); for (auto queue : info.command_queues) state_.context->add_diagnostic_queue(queue); for (auto queue : info.compute_queues) state_.context->add_diagnostic_queue(queue); @@ -15051,7 +15051,7 @@ class Device final } state_.context->enable_depth24(get_device, [this](const VkMemoryRequirements& requirements) { return state_.allocate(requirements, 0, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); - }, max_storage_range); + }, max_storage_range, state_.families); } if (info.bindless && state_.context->loaded() && !create_bindless(get_device)) std::fprintf(stderr, "[rt] d3d12: the bindless set 0 could not be created\n"); diff --git a/runtime/src/vulkan_backend.h b/runtime/src/vulkan_backend.h index 18bcc07baa..88f1764441 100644 --- a/runtime/src/vulkan_backend.h +++ b/runtime/src/vulkan_backend.h @@ -1325,11 +1325,14 @@ class VulkanContext { bool loaded() const { return loaded_; } - // `memory`: the physical device's memory types, for the AMD marker buffer (enabled.markers). + // `memory`: the physical device's memory types, for the AMD marker buffer (enabled.markers); `families`: the + // device's distinct queue families, which all write that buffer. void configure_device_fault(PFN_vkGetDeviceProcAddr get, DeviceFaultExtensions enabled, - const VkPhysicalDeviceMemoryProperties* memory = nullptr) { + const VkPhysicalDeviceMemoryProperties* memory = nullptr, + std::vector families = {}) { device_fault_ = std::make_unique(get, device_, enabled, memory, - vk.vkCmdPipelineBarrier2 != nullptr); + vk.vkCmdPipelineBarrier2 != nullptr, + std::move(families)); device_fault_->set_submit_lock(&submit_mutex_); if (fence_dispatcher_) fence_dispatcher_->set_device_fault(device_fault_.get()); if (loaded_) progress_watch_ = std::jthread([this](std::stop_token stop) { watch_queue_progress(stop); }); @@ -1911,12 +1914,13 @@ class VulkanContext { } // D24_UNORM_S8_UINT stored as D32: copies of its depth plane run a compute pass (vulkan_depth24.h). `allocate` - // gives the scratch buffers device-local memory. Without this such a copy is refused as unsupported. + // gives the scratch buffers device-local memory, shared by `families` (the device's distinct queue families). + // Without this such a copy is refused as unsupported. void enable_depth24(PFN_vkGetDeviceProcAddr get, Depth24Converter::Allocate allocate, - std::uint64_t max_storage_range = 1u << 27) { + std::uint64_t max_storage_range = 1u << 27, std::vector families = {}) { std::unique_lock lock(resource_mutex_); depth24_ = std::make_unique(get, device_, std::move(allocate), max_storage_range, - device_fault_.get()); + device_fault_.get(), std::move(families)); if (!depth24_->loaded()) { depth24_.reset(); return; diff --git a/runtime/src/vulkan_depth24.h b/runtime/src/vulkan_depth24.h index 3c8a13cf73..96c648b673 100644 --- a/runtime/src/vulkan_depth24.h +++ b/runtime/src/vulkan_depth24.h @@ -22,6 +22,7 @@ #include "depth24.h" #include "depth24_convert_spv.h" +#include "queue_families.h" #include "vulkan_aftermath.h" namespace leonida { @@ -32,9 +33,13 @@ class Depth24Converter { using Allocate = std::function; // `max_range`: the device's maxStorageBufferRange; a copy is split into dispatches that stay inside it. + // `families`: the device's distinct queue families. A scratch chunk is reused by copies on any D3D12 queue + // (direct, compute or copy), so with more than one family it is made CONCURRENT over all of them. Depth24Converter(PFN_vkGetDeviceProcAddr get, VkDevice device, Allocate allocate, - std::uint64_t max_range = 1u << 27, DeviceFaultDiagnostics* diagnostics = nullptr) - : device_(device), diagnostics_(diagnostics), allocate_(std::move(allocate)), max_range_(max_range) { + std::uint64_t max_range = 1u << 27, DeviceFaultDiagnostics* diagnostics = nullptr, + std::vector families = {}) + : device_(device), diagnostics_(diagnostics), allocate_(std::move(allocate)), max_range_(max_range), + families_(std::move(families)) { loaded_ = vk_.load(get, device); } @@ -335,6 +340,7 @@ class Depth24Converter { VkBufferCreateInfo info{VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO}; info.size = size; info.usage = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; + share_across_queue_families(info, families_); if (vk_.vkCreateBuffer(device_, &info, nullptr, &out.buffer) != VK_SUCCESS) return false; VkMemoryRequirements requirements{}; vk_.vkGetBufferMemoryRequirements(device_, out.buffer, &requirements); @@ -364,6 +370,7 @@ class Depth24Converter { DeviceFaultDiagnostics* diagnostics_; Allocate allocate_; std::uint64_t max_range_; + std::vector families_; Functions vk_; bool loaded_ = false; VkDescriptorSetLayout set_layout_ = VK_NULL_HANDLE; diff --git a/runtime/src/vulkan_device_fault.h b/runtime/src/vulkan_device_fault.h index 3c49fce8d2..ed75651772 100644 --- a/runtime/src/vulkan_device_fault.h +++ b/runtime/src/vulkan_device_fault.h @@ -1155,10 +1155,11 @@ struct SubmitRecord { class DeviceFaultDiagnostics { public: - // `memory` and `synchronization2` are for the AMD markers (enabled.markers): where their buffer goes and whether - // vkCmdWriteBufferMarker2AMD may be used. + // `memory`, `synchronization2` and `families` are for the AMD markers (enabled.markers): where their buffer goes, + // whether vkCmdWriteBufferMarker2AMD may be used, and the device's distinct queue families, which all write it. DeviceFaultDiagnostics(PFN_vkGetDeviceProcAddr get, VkDevice device, DeviceFaultExtensions enabled, - const VkPhysicalDeviceMemoryProperties* memory = nullptr, bool synchronization2 = false) + const VkPhysicalDeviceMemoryProperties* memory = nullptr, bool synchronization2 = false, + std::vector families = {}) : device_(device) { #define LEONIDA_FAULT_LOAD(name) name = reinterpret_cast(get(device, #name)) if (enabled.fault) LEONIDA_FAULT_LOAD(vkGetDeviceFaultInfoEXT); @@ -1171,7 +1172,7 @@ class DeviceFaultDiagnostics { std::fprintf(stderr, "[rt] device-fault: enabled (fault info %s, checkpoints %s, NVIDIA diagnostics config %s)\n", vkGetDeviceFaultInfoEXT ? "on" : "unavailable", checkpoint_command() ? "on" : "unavailable", enabled.diagnostics_config ? "on" : "unavailable"); - if (enabled.markers) enable_markers(get, memory, synchronization2); + if (enabled.markers) enable_markers(get, memory, synchronization2, families); else if (device_markers_requested()) std::fprintf(stderr, "[rt] device-markers: unavailable: the device has no VK_AMD_buffer_marker\n"); } @@ -1452,10 +1453,10 @@ class DeviceFaultDiagnostics { private: void enable_markers(PFN_vkGetDeviceProcAddr get, const VkPhysicalDeviceMemoryProperties* memory, - bool synchronization2) { + bool synchronization2, std::span families) { auto markers = std::make_unique(); - const VkResult result = - memory ? markers->create(get, device_, *memory, synchronization2) : VK_ERROR_INITIALIZATION_FAILED; + const VkResult result = memory ? markers->create(get, device_, *memory, synchronization2, families) + : VK_ERROR_INITIALIZATION_FAILED; if (result != VK_SUCCESS) { std::fprintf(stderr, "[rt] device-markers: unavailable: the marker buffer could not be made (%d)\n", int(result)); diff --git a/runtime/src/vulkan_device_markers.h b/runtime/src/vulkan_device_markers.h index fea7e578bc..8e0e261355 100644 --- a/runtime/src/vulkan_device_markers.h +++ b/runtime/src/vulkan_device_markers.h @@ -21,6 +21,8 @@ #include #include +#include "queue_families.h" + namespace leonida { inline bool device_markers_requested() { @@ -145,9 +147,9 @@ class DeviceMarkers { if (memory_ && free_memory_) free_memory_(device_, memory_, nullptr); } - // Returns the VkResult of the step that failed, or VK_SUCCESS. + // Returns the VkResult of the step that failed, or VK_SUCCESS. `families`: the device's distinct queue families. VkResult create(PFN_vkGetDeviceProcAddr get, VkDevice device, const VkPhysicalDeviceMemoryProperties& memory, - bool synchronization2) { + bool synchronization2, std::span families = {}) { device_ = device; #define LEONIDA_MARKER_LOAD(type, name) const auto name = reinterpret_cast(get(device, #name)) LEONIDA_MARKER_LOAD(PFN_vkCreateBuffer, vkCreateBuffer); @@ -169,7 +171,10 @@ class DeviceMarkers { VkBufferCreateInfo info{VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO}; info.size = VkDeviceSize{8} * max_queues; info.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT; - info.sharingMode = VK_SHARING_MODE_EXCLUSIVE; // written by every queue, never read on the GPU + // Every queue writes it (it is never read on the GPU), whichever family the queue is on: CONCURRENT over the + // device's families when there is more than one, as two families may not use an EXCLUSIVE buffer without an + // ownership transfer. + share_across_queue_families(info, families); VkResult result = vkCreateBuffer(device, &info, nullptr, &buffer_); if (result != VK_SUCCESS) return result; VkMemoryRequirements requirements{}; diff --git a/runtime/test/depth24_scratch_sharing_test.cpp b/runtime/test/depth24_scratch_sharing_test.cpp new file mode 100644 index 0000000000..b0586ec4b6 --- /dev/null +++ b/runtime/test/depth24_scratch_sharing_test.cpp @@ -0,0 +1,166 @@ +// The depth24 converter's scratch chunks (src/vulkan_depth24.h) are reused by copies on every D3D12 queue, direct, +// compute and copy, which may be three Vulkan queue families: with two or more families a chunk is CONCURRENT over +// all of them, as the device's other shared pools are (ScratchBuffers, IndirectArgumentClamp, BindlessSet); with one +// family, or none given, it stays EXCLUSIVE. On the CPU: the driver is faked and the chunk's VkBufferCreateInfo is +// logged. No GPU, no game data. +#include "../src/vulkan_depth24.h" + +#include +#include +#include +#include +#include + +#define EXPECT(condition) do { \ + if (!(condition)) { std::fprintf(stderr, "line %d: %s\n", __LINE__, #condition); return 1; } \ +} while (0) + +using namespace leonida; + +namespace { + +template +Handle fake_handle(std::uintptr_t value) { + if constexpr (std::is_pointer_v) return reinterpret_cast(value); + else return Handle(value); +} + +struct Created { + VkDeviceSize size; + VkSharingMode sharing; + std::vector families; +}; +std::vector buffers; +std::uintptr_t next_handle = 0x1000; + +VKAPI_ATTR VkResult VKAPI_CALL create_buffer(VkDevice, const VkBufferCreateInfo* info, const VkAllocationCallbacks*, + VkBuffer* buffer) { + Created c{info->size, info->sharingMode, {}}; + if (info->sharingMode == VK_SHARING_MODE_CONCURRENT) + c.families.assign(info->pQueueFamilyIndices, info->pQueueFamilyIndices + info->queueFamilyIndexCount); + buffers.push_back(c); + *buffer = fake_handle(next_handle++); + return VK_SUCCESS; +} +VKAPI_ATTR void VKAPI_CALL destroy_buffer(VkDevice, VkBuffer, const VkAllocationCallbacks*) {} +VKAPI_ATTR void VKAPI_CALL requirements(VkDevice, VkBuffer, VkMemoryRequirements* out) { *out = {4u << 20, 256, 1}; } +VKAPI_ATTR VkResult VKAPI_CALL bind(VkDevice, VkBuffer, VkDeviceMemory, VkDeviceSize) { return VK_SUCCESS; } +VKAPI_ATTR void VKAPI_CALL free_memory(VkDevice, VkDeviceMemory, const VkAllocationCallbacks*) {} +VKAPI_ATTR VkResult VKAPI_CALL create_module(VkDevice, const VkShaderModuleCreateInfo*, const VkAllocationCallbacks*, + VkShaderModule* out) { + *out = fake_handle(next_handle++); + return VK_SUCCESS; +} +VKAPI_ATTR void VKAPI_CALL destroy_module(VkDevice, VkShaderModule, const VkAllocationCallbacks*) {} +VKAPI_ATTR VkResult VKAPI_CALL create_set_layout(VkDevice, const VkDescriptorSetLayoutCreateInfo*, + const VkAllocationCallbacks*, VkDescriptorSetLayout* out) { + *out = fake_handle(next_handle++); + return VK_SUCCESS; +} +VKAPI_ATTR void VKAPI_CALL destroy_set_layout(VkDevice, VkDescriptorSetLayout, const VkAllocationCallbacks*) {} +VKAPI_ATTR VkResult VKAPI_CALL create_pipeline_layout(VkDevice, const VkPipelineLayoutCreateInfo*, + const VkAllocationCallbacks*, VkPipelineLayout* out) { + *out = fake_handle(next_handle++); + return VK_SUCCESS; +} +VKAPI_ATTR void VKAPI_CALL destroy_pipeline_layout(VkDevice, VkPipelineLayout, const VkAllocationCallbacks*) {} +VKAPI_ATTR VkResult VKAPI_CALL create_pipelines(VkDevice, VkPipelineCache, std::uint32_t count, + const VkComputePipelineCreateInfo*, const VkAllocationCallbacks*, + VkPipeline* out) { + for (std::uint32_t i = 0; i < count; ++i) out[i] = fake_handle(next_handle++); + return VK_SUCCESS; +} +VKAPI_ATTR void VKAPI_CALL destroy_pipeline(VkDevice, VkPipeline, const VkAllocationCallbacks*) {} +VKAPI_ATTR VkResult VKAPI_CALL create_pool(VkDevice, const VkDescriptorPoolCreateInfo*, const VkAllocationCallbacks*, + VkDescriptorPool* out) { + *out = fake_handle(next_handle++); + return VK_SUCCESS; +} +VKAPI_ATTR void VKAPI_CALL destroy_pool(VkDevice, VkDescriptorPool, const VkAllocationCallbacks*) {} +VKAPI_ATTR VkResult VKAPI_CALL allocate_sets(VkDevice, const VkDescriptorSetAllocateInfo* info, VkDescriptorSet* out) { + for (std::uint32_t i = 0; i < info->descriptorSetCount; ++i) out[i] = fake_handle(next_handle++); + return VK_SUCCESS; +} +VKAPI_ATTR void VKAPI_CALL update_sets(VkDevice, std::uint32_t, const VkWriteDescriptorSet*, std::uint32_t, + const VkCopyDescriptorSet*) {} +VKAPI_ATTR void VKAPI_CALL bind_pipeline(VkCommandBuffer, VkPipelineBindPoint, VkPipeline) {} +VKAPI_ATTR void VKAPI_CALL bind_sets(VkCommandBuffer, VkPipelineBindPoint, VkPipelineLayout, std::uint32_t, + std::uint32_t, const VkDescriptorSet*, std::uint32_t, const std::uint32_t*) {} +VKAPI_ATTR void VKAPI_CALL push_constants(VkCommandBuffer, VkPipelineLayout, VkShaderStageFlags, std::uint32_t, + std::uint32_t, const void*) {} +VKAPI_ATTR void VKAPI_CALL dispatch(VkCommandBuffer, std::uint32_t, std::uint32_t, std::uint32_t) {} +VKAPI_ATTR VkResult VKAPI_CALL counter_value(VkDevice, VkSemaphore, std::uint64_t* value) { + *value = ~std::uint64_t{0}; + return VK_SUCCESS; +} +VKAPI_ATTR VkResult VKAPI_CALL wait_idle(VkDevice) { return VK_SUCCESS; } + +VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL get_proc(VkDevice, const char* name) { +#define LEONIDA_FAKE(entry, fn) if (!std::strcmp(name, entry)) return reinterpret_cast(fn) + LEONIDA_FAKE("vkCreateBuffer", create_buffer); + LEONIDA_FAKE("vkDestroyBuffer", destroy_buffer); + LEONIDA_FAKE("vkGetBufferMemoryRequirements", requirements); + LEONIDA_FAKE("vkBindBufferMemory", bind); + LEONIDA_FAKE("vkFreeMemory", free_memory); + LEONIDA_FAKE("vkCreateShaderModule", create_module); + LEONIDA_FAKE("vkDestroyShaderModule", destroy_module); + LEONIDA_FAKE("vkCreateDescriptorSetLayout", create_set_layout); + LEONIDA_FAKE("vkDestroyDescriptorSetLayout", destroy_set_layout); + LEONIDA_FAKE("vkCreatePipelineLayout", create_pipeline_layout); + LEONIDA_FAKE("vkDestroyPipelineLayout", destroy_pipeline_layout); + LEONIDA_FAKE("vkCreateComputePipelines", create_pipelines); + LEONIDA_FAKE("vkDestroyPipeline", destroy_pipeline); + LEONIDA_FAKE("vkCreateDescriptorPool", create_pool); + LEONIDA_FAKE("vkDestroyDescriptorPool", destroy_pool); + LEONIDA_FAKE("vkAllocateDescriptorSets", allocate_sets); + LEONIDA_FAKE("vkUpdateDescriptorSets", update_sets); + LEONIDA_FAKE("vkCmdBindPipeline", bind_pipeline); + LEONIDA_FAKE("vkCmdBindDescriptorSets", bind_sets); + LEONIDA_FAKE("vkCmdPushConstants", push_constants); + LEONIDA_FAKE("vkCmdDispatch", dispatch); + LEONIDA_FAKE("vkGetSemaphoreCounterValue", counter_value); + LEONIDA_FAKE("vkDeviceWaitIdle", wait_idle); +#undef LEONIDA_FAKE + return nullptr; +} + +// A readback of a 64x64 D24 footprint: prepare() makes one scratch chunk for it. +Depth24Job job() { + Depth24Job j; + j.app = fake_handle(0x10); + j.app_size = 64 * 64 * 4; + j.width = j.height = 64; + j.slices = 1; + j.app_row_words = 64; + j.app_slice_words = 64 * 64; + return j; +} + +// The chunk prepare() makes for one copy with the converter given `families`. +int chunk_sharing(std::vector families, VkSharingMode mode, std::vector expect) { + buffers.clear(); + Depth24Converter converter(get_proc, fake_handle(0x1), + [](const VkMemoryRequirements&) { return fake_handle(0x20); }, + 1u << 27, nullptr, std::move(families)); + EXPECT(converter.loaded()); + Depth24Job whole = job(); + std::vector parts; + EXPECT(converter.prepare(whole, parts) && whole.scratch && parts.size() == 1); + EXPECT(buffers.size() == 1); + EXPECT(buffers[0].sharing == mode && buffers[0].families == expect); + return 0; +} + +} // namespace + +int main() { + // Graphics, async compute and DMA families: the chunk is shared by all three. + if (int failed = chunk_sharing({0, 1, 2}, VK_SHARING_MODE_CONCURRENT, {0, 1, 2})) return failed; + // Copies on the async-compute family (no DMA family). + if (int failed = chunk_sharing({0, 2}, VK_SHARING_MODE_CONCURRENT, {0, 2})) return failed; + // One family (every D3D12 queue on the graphics family), or none given: EXCLUSIVE, as before. + if (int failed = chunk_sharing({0}, VK_SHARING_MODE_EXCLUSIVE, {})) return failed; + if (int failed = chunk_sharing({}, VK_SHARING_MODE_EXCLUSIVE, {})) return failed; + std::puts("depth24_scratch_sharing: ok"); + return 0; +} diff --git a/runtime/test/vulkan_device_markers_test.cpp b/runtime/test/vulkan_device_markers_test.cpp index 64693a83d5..40faee0622 100644 --- a/runtime/test/vulkan_device_markers_test.cpp +++ b/runtime/test/vulkan_device_markers_test.cpp @@ -34,10 +34,14 @@ struct Write { std::vector writes; std::uint32_t words[2 * DeviceMarkers::max_queues]; bool mapped = false, unmapped = false, freed = false; +VkSharingMode sharing = VK_SHARING_MODE_MAX_ENUM; // the marker buffer's, as created +std::vector sharing_families; VKAPI_ATTR VkResult VKAPI_CALL create_buffer(VkDevice, const VkBufferCreateInfo* info, const VkAllocationCallbacks*, VkBuffer* buffer) { if (info->size < sizeof(words)) return VK_ERROR_UNKNOWN; + sharing = info->sharingMode; + sharing_families.assign(info->pQueueFamilyIndices, info->pQueueFamilyIndices + info->queueFamilyIndexCount); *buffer = fake_handle(0x100); return VK_SUCCESS; } @@ -288,6 +292,37 @@ int extension_request() { return 0; } +// The marker buffer is written by every queue, on any of the device's families: CONCURRENT over them when there +// are two or more (an EXCLUSIVE buffer may not be used by two families without an ownership transfer), EXCLUSIVE +// with one family or none given. +int queue_family_sharing() { + const auto memory = memory_types(); + DeviceFaultExtensions enabled; + enabled.markers = true; + { + DeviceFaultDiagnostics diagnostics(get_proc, VK_NULL_HANDLE, enabled, &memory, true, {0, 1, 2}); + EXPECT(diagnostics.markers_on()); + EXPECT(sharing == VK_SHARING_MODE_CONCURRENT && sharing_families == std::vector({0, 1, 2})); + } + { + DeviceFaultDiagnostics diagnostics(get_proc, VK_NULL_HANDLE, enabled, &memory, false, {0, 2}); + EXPECT(diagnostics.markers_on()); + EXPECT(sharing == VK_SHARING_MODE_CONCURRENT && sharing_families == std::vector({0, 2})); + } + { + DeviceFaultDiagnostics diagnostics(get_proc, VK_NULL_HANDLE, enabled, &memory, true, {0}); + EXPECT(diagnostics.markers_on()); + EXPECT(sharing == VK_SHARING_MODE_EXCLUSIVE && sharing_families.empty()); + } + { + DeviceMarkers markers; + const std::uint32_t families[] = {3, 1}; + EXPECT(markers.create(get_proc, VK_NULL_HANDLE, memory, false, families) == VK_SUCCESS); + EXPECT(sharing == VK_SHARING_MODE_CONCURRENT && sharing_families == std::vector({3, 1})); + } + return 0; +} + } // namespace int main() { @@ -295,6 +330,7 @@ int main() { if (int failed = recorded(true)) return failed; if (int failed = recorded(false)) return failed; if (int failed = extension_request()) return failed; + if (int failed = queue_family_sharing()) return failed; std::puts("vulkan_device_markers: ok"); return 0; }