Added support for VK_KHR_PIPELINE_EXECUTABLE_PROPERTIES#1003
Added support for VK_KHR_PIPELINE_EXECUTABLE_PROPERTIES#1003karimsayedre wants to merge 2 commits intomasterfrom
Conversation
include/nbl/video/ILogicalDevice.h
Outdated
| NBL_LOG_ERROR("Feature `pipelineExecutableInfo` is not enabled"); | ||
| return {}; | ||
| } | ||
| return getPipelineExecutableReport_impl(pipeline->getNativeHandle(), includeInternalRepresentations); |
There was a problem hiding this comment.
you shall not call getNativeHandle here, this is not How Nabla works
include/nbl/video/ILogicalDevice.h
Outdated
| // If includeInternalRepresentations is true, also includes shader IR/assembly | ||
| // (pipeline must have been created with CAPTURE_INTERNAL_REPRESENTATIONS flag). | ||
| template<typename Pipeline> | ||
| std::string getPipelineExecutableReport(const Pipeline* pipeline, bool includeInternalRepresentations = false) |
There was a problem hiding this comment.
one string for stats, one string for internal rep, make it a nice named struct
There was a problem hiding this comment.
actually a vector of named structs, one per executable
| report += "======== "; | ||
| report += prop.name; | ||
| report += " ========\n"; | ||
| report += prop.description; | ||
| report += "\n"; |
There was a problem hiding this comment.
try to avoid adding extra formatting
There was a problem hiding this comment.
the standard stuff should go in one string, the customizable/driver-specific should go in another and IR should go in the 3rd
There was a problem hiding this comment.
actually if you want to do a formatted output (with titles and divisors) you can specialize system::to_string_helper for the named struct in ILogicalDevice containing the report :D
| core::vector<VkPipelineExecutablePropertiesKHR> properties(executableCount); | ||
| for (uint32_t i = 0; i < executableCount; ++i) | ||
| properties[i] = {VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_PROPERTIES_KHR, nullptr}; | ||
| m_devf.vk.vkGetPipelineExecutablePropertiesKHR(m_vkdev, &pipelineInfo, &executableCount, properties.data()); |
There was a problem hiding this comment.
do the executables have any identifiers or something similar ?
I know a pipeline may compile into more or less executables than stages and there isn't a clear mapping, but is there a hash, name or anything ?
There was a problem hiding this comment.
There is no hash, name + stages is the closest thing to an identifier
…cks, `getPipelineExecutableProperties_impl` overloads with one helper function
| std::string CVulkanLogicalDevice::getPipelineExecutableReport_impl(const void* nativeHandle, bool includeInternalRepresentations) | ||
| core::vector<ILogicalDevice::SPipelineExecutableInfo> CVulkanLogicalDevice::getPipelineExecutableProperties_impl(const IGPUComputePipeline* pipeline, bool includeInternalRepresentations) | ||
| { | ||
| const VkPipeline vkPipeline = *reinterpret_cast<const VkPipeline*>(nativeHandle); |
There was a problem hiding this comment.
Does that look better?
Notes: