MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Samples / update_debug_window

Method update_debug_window

framework/vulkan_sample.h:1689–1716  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1687
1688template <vkb::BindingType bindingType>
1689inline void VulkanSample<bindingType>::update_debug_window()
1690{
1691 auto driver_version = device->get_gpu().get_driver_version();
1692 std::string driver_version_str = fmt::format("major: {} minor: {} patch: {}", driver_version.major, driver_version.minor, driver_version.patch);
1693
1694 get_debug_info().template insert<field::Static, std::string>("driver_version", driver_version_str);
1695 get_debug_info().template insert<field::Static, std::string>("resolution",
1696 to_string(static_cast<VkExtent2D const &>(render_context->get_swapchain().get_extent())));
1697 get_debug_info().template insert<field::Static, std::string>("surface_format",
1698 to_string(render_context->get_swapchain().get_format()) + " (" +
1699 to_string(vkb::common::get_bits_per_pixel(render_context->get_swapchain().get_format())) +
1700 "bpp)");
1701
1702 if (scene != nullptr)
1703 {
1704 get_debug_info().template insert<field::Static, uint32_t>("mesh_count", to_u32(scene->get_components<sg::SubMesh>().size()));
1705 get_debug_info().template insert<field::Static, uint32_t>("texture_count", to_u32(scene->get_components<sg::Texture>().size()));
1706
1707 if (auto camera = scene->get_components<vkb::sg::Camera>()[0])
1708 {
1709 if (auto camera_node = camera->get_node())
1710 {
1711 const glm::vec3 &pos = camera_node->get_transform().get_translation();
1712 get_debug_info().template insert<field::Vector, float>("camera_pos", pos.x, pos.y, pos.z);
1713 }
1714 }
1715 }
1716}
1717
1718template <vkb::BindingType bindingType>
1719inline void VulkanSample<bindingType>::update_gui(float delta_time)

Callers

nothing calls this directly

Calls 8

to_u32Function · 0.85
get_driver_versionMethod · 0.80
sizeMethod · 0.80
to_stringFunction · 0.50
get_bits_per_pixelFunction · 0.50
get_formatMethod · 0.45
get_nodeMethod · 0.45
get_transformMethod · 0.45

Tested by

no test coverage detected