layout_info.pPushConstantRanges = &push_const_range;
vk.CreatePipelineLayout(layout_info, layout_handle);
+
+#if DEBUG
+ if(!debug_name.empty())
+ set_vulkan_object_name();
+#endif
}
void VulkanProgram::set_debug_name(const string &name)
{
#ifdef DEBUG
debug_name = name;
+ set_vulkan_object_name();
if(SpirVModule *spirv = static_cast<Program *>(this)->specialized_spirv)
spirv->set_debug_name(debug_name);
#else
#endif
}
+void VulkanProgram::set_vulkan_object_name() const
+{
+#ifdef DEBUG
+ const VulkanFunctions &vk = device.get_functions();
+
+ string layout_name = debug_name+" [layout]";
+
+ VkDebugUtilsObjectNameInfoEXT name_info = { };
+ name_info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT;
+ name_info.objectType = VK_OBJECT_TYPE_PIPELINE_LAYOUT;
+ name_info.objectHandle = reinterpret_cast<uint64_t>(layout_handle);
+ name_info.pObjectName = layout_name.c_str();
+ vk.SetDebugUtilsObjectName(name_info);
+
+ name_info.objectType = VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT;
+ for(unsigned i=0; i<desc_set_layout_handles.size(); ++i)
+ {
+ layout_name = format("%s [layout:%d]", debug_name, i);
+ name_info.objectHandle = reinterpret_cast<uint64_t>(desc_set_layout_handles[i]);
+ name_info.pObjectName = layout_name.c_str();
+ vk.SetDebugUtilsObjectName(name_info);
+ }
+#endif
+}
+
} // namespace GL
} // namespace Msp