1010#include " nbl/video/SPipelineCreationParams.h"
1111#include " nbl/asset/ICPUPipeline.h"
1212#include " nbl/asset/IPipeline.h"
13+ #include " nbl/system/to_string.h"
1314
1415namespace nbl ::video
1516{
@@ -127,6 +128,21 @@ class IGPUPipelineBase {
127128
128129 using SShaderEntryMap = SShaderSpecInfo::entry_map_t ;
129130
131+ // Per-executable info from VK_KHR_pipeline_executable_properties
132+ struct SExecutableInfo
133+ {
134+ std::string name;
135+ std::string description;
136+ core::bitflag<hlsl::ShaderStage> stages = hlsl::ShaderStage::ESS_UNKNOWN;
137+ uint32_t subgroupSize = 0 ;
138+ std::string statistics;
139+ std::string internalRepresentations;
140+ };
141+
142+ inline std::span<const SExecutableInfo> getExecutableInfo () const { return m_executableInfo; }
143+
144+ protected:
145+ core::vector<SExecutableInfo> m_executableInfo;
130146};
131147
132148// Common Base class for pipelines
@@ -142,6 +158,55 @@ class IGPUPipeline : public IBackendObject, public PipelineNonBackendObjectBase,
142158 {}
143159 virtual ~IGPUPipeline () = default ;
144160
161+ virtual void populateExecutableInfo (bool includeInternalRepresentations) = 0;
162+
163+ };
164+
165+ }
166+
167+ namespace nbl ::system::impl
168+ {
169+
170+ template <>
171+ struct to_string_helper <video::IGPUPipelineBase::SExecutableInfo>
172+ {
173+ static std::string __call (const video::IGPUPipelineBase::SExecutableInfo& info)
174+ {
175+ std::string result;
176+ result += " ======== " ;
177+ result += info.name ;
178+ result += " ========\n " ;
179+ result += info.description ;
180+ result += " \n Subgroup Size: " ;
181+ result += std::to_string (info.subgroupSize );
182+ if (!info.statistics .empty ())
183+ {
184+ result += " \n " ;
185+ result += info.statistics ;
186+ }
187+ if (!info.internalRepresentations .empty ())
188+ {
189+ result += " \n " ;
190+ result += info.internalRepresentations ;
191+ }
192+ return result;
193+ }
194+ };
195+
196+ // Another version for core::vector?
197+ template <>
198+ struct to_string_helper <std::span<const video::IGPUPipelineBase::SExecutableInfo>>
199+ {
200+ static std::string __call (const std::span<const video::IGPUPipelineBase::SExecutableInfo>& infos)
201+ {
202+ std::string result;
203+ for (const auto & info : infos)
204+ {
205+ result += to_string_helper<video::IGPUPipelineBase::SExecutableInfo>::__call (info);
206+ result += " \n " ;
207+ }
208+ return result;
209+ }
145210};
146211
147212}
0 commit comments