MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ root_graphics_buffer()

InspectResult MayaFlux::Portal::Forma::Inspector::root_graphics_buffer ( Buffers::ProcessingToken  token,
Surface surface,
LayoutCursor cursor,
float  x_min = -0.95F,
float  x_max = 0.95F,
float  row_h = 0.05F,
int  depth = 0 
)

Inspect the root graphics buffer for a token.

Header shows token. Row shows VKBuffer child count. The root buffer itself is expanded via buffer(), then each VKBuffer child via buffer().

Definition at line 200 of file BufferQuery.cpp.

205{
206 auto root = m_bm.get_root_graphics_buffer(token);
207 const auto children = root->get_child_buffers();
208
209 const float ind = x_min + static_cast<float>(depth) * k_inspect_indent;
210 const std::string header_label = "graphics ["
211 + std::string(Reflect::enum_to_string(token)) + "]";
212
213 std::vector<ValueSpec> values {
214 ValueSpec {
215 .label = "vk_buffers",
216 .reader = [root] { return std::to_string(root->get_buffer_count()); },
217 },
218 };
219
220 const auto dims = row_pixel_dims(surface.window(), ind, x_max, row_h);
221 auto hbuf = make_row_buffer(surface.window(), header_label, dims);
222 std::vector<RowBuffer> rbufs;
223 rbufs.reserve(values.size());
224 for (const auto& spec : values)
225 rbufs.push_back(make_row_buffer(surface.window(), spec.label, dims));
226 auto group = make_value_group(values, std::move(hbuf), rbufs,
227 surface, cursor, ind, x_max, row_h, false);
228
229 InspectResult result;
230 result.group = std::move(group);
231
232 auto root_result = buffer(
233 root, surface, cursor,
234 x_min, x_max, row_h, depth + 1);
235 surface.layer().relate(result.group.header.header_id, root_result.group.header.header_id);
236 result.children.push_back(std::move(root_result));
237
238 for (const auto& child : children) {
239 auto child_result = buffer(
240 child, surface, cursor,
241 x_min, x_max, row_h, depth + 2);
242 surface.layer().relate(result.group.header.header_id, child_result.group.header.header_id);
243 result.children.push_back(std::move(child_result));
244 }
245
246 return result;
247}
std::shared_ptr< RootGraphicsBuffer > get_root_graphics_buffer(ProcessingToken token)
Gets a root graphics buffer for a specific token.
RowBuffer make_row_buffer(const std::shared_ptr< Core::Window > &window, std::string_view text, glm::uvec2 pixel_dims) const
Definition Inspector.cpp:13
InspectResult buffer(const std::shared_ptr< Buffers::Buffer > &buf, Surface &surface, LayoutCursor &cursor, float x_min=-0.95F, float x_max=0.95F, float row_h=0.05F, int depth=0)
Inspect a single Buffer: default processor and full processing chain.
Buffers::BufferManager & m_bm
ValueGroup make_value_group(std::span< const ValueSpec > values, RowBuffer header_buf, std::span< const RowBuffer > row_bufs, Surface &surface, LayoutCursor &cursor, float x_min, float x_max, float row_h, bool initially_open)
Construct a collapsible header followed by N value rows under it.
constexpr float k_inspect_indent
glm::uvec2 row_pixel_dims(const std::shared_ptr< Core::Window > &window, float x_min, float x_max, float row_h)
Convert an NDC row rect into integer pixel dimensions.
constexpr std::string_view enum_to_string(EnumType value) noexcept
Universal enum to string converter using magic_enum (original case)

References buffer(), MayaFlux::Portal::Forma::InspectResult::children, MayaFlux::Reflect::enum_to_string(), MayaFlux::Buffers::BufferManager::get_root_graphics_buffer(), MayaFlux::Portal::Forma::InspectResult::group, MayaFlux::Portal::Forma::ValueGroup::header, MayaFlux::Portal::Forma::Collapsible::header_id, MayaFlux::Portal::Forma::k_inspect_indent, MayaFlux::Portal::Forma::ValueSpec::label, MayaFlux::Portal::Forma::Surface::layer(), m_bm, make_row_buffer(), MayaFlux::Portal::Forma::make_value_group(), MayaFlux::Portal::Forma::Layer::relate(), MayaFlux::Portal::Forma::row_pixel_dims(), and MayaFlux::Portal::Forma::Surface::window().

Referenced by buffer_manager().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: