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

Method select_physical_device

framework/vulkan_sample.h:1558–1599  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1556 if constexpr (bindingType == BindingType::Cpp)
1557 {
1558 set_viewport_and_scissor_impl(command_buffer, extent);
1559 }
1560 else
1561 {
1562 set_viewport_and_scissor_impl(reinterpret_cast<vkb::core::CommandBufferCpp const &>(command_buffer),
1563 reinterpret_cast<vk::Extent2D const &>(extent));
1564 }
1565}
1566
1567template <vkb::BindingType bindingType>
1568inline void VulkanSample<bindingType>::set_viewport_and_scissor_impl(vkb::core::CommandBufferCpp const &command_buffer,
1569 vk::Extent2D const &extent)
1570{
1571 command_buffer.get_handle().setViewport(0, {{0.0f, 0.0f, static_cast<float>(extent.width), static_cast<float>(extent.height), 0.0f, 1.0f}});
1572 command_buffer.get_handle().setScissor(0, vk::Rect2D{{}, extent});
1573}
1574
1575template <vkb::BindingType bindingType>
1576inline void VulkanSample<bindingType>::update(float delta_time)
1577{
1578 vkb::Application::update(delta_time);
1579
1580 update_scene(delta_time);
1581
1582 update_gui(delta_time);
1583
1584 auto command_buffer = render_context->begin();
1585
1586 // Collect the performance data for the sample graphs
1587 update_stats(delta_time);
1588
1589 command_buffer->begin(vk::CommandBufferUsageFlagBits::eOneTimeSubmit);
1590 stats->begin_sampling(*command_buffer);
1591
1592 if constexpr (bindingType == BindingType::Cpp)
1593 {
1594 draw(*command_buffer, render_context->get_active_frame().get_render_target());
1595 }
1596 else
1597 {
1598 draw(reinterpret_cast<vkb::core::CommandBufferC &>(*command_buffer),
1599 reinterpret_cast<vkb::rendering::RenderTargetC &>(render_context->get_active_frame().get_render_target()));
1600 }
1601
1602 stats->end_sampling(*command_buffer);

Callers

nothing calls this directly

Calls 4

emptyMethod · 0.80
sizeMethod · 0.80
get_handleMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected