Add image() accessor in xr::swapchain

This commit is contained in:
Patrick Nicolas
2026-03-02 10:57:46 +01:00
parent f32d6f4710
commit 6859db7c34
3 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -845,7 +845,7 @@ std::vector<std::pair<int, XrCompositionLayerQuad>> imgui_context::end_frame()
application::haptic_start(haptic_output, XR_NULL_PATH, 10'000'000, 1000, 1);
}
vk::Image destination = swapchain.images()[image_index];
vk::Image destination = swapchain.image(image_index);
ImGui::SetCurrentContext(context);
ImPlot::SetCurrentContext(plot_context);
+2 -2
View File
@@ -166,7 +166,7 @@ void scene::render_world(
xr::swapchain & color_swapchain = get_swapchain(swapchain_format, width, height, 1, views.size());
int color_image_index = color_swapchain.acquire();
vk::Image color_image = color_swapchain.images()[color_image_index];
vk::Image color_image = color_swapchain.image(color_image_index);
color_swapchain.wait();
return {color_swapchain, color_image};
}();
@@ -177,7 +177,7 @@ void scene::render_world(
xr::swapchain & depth_swapchain = get_swapchain(depth_format, width, height, 1, views.size());
int depth_image_index = depth_swapchain.acquire();
vk::Image depth_image = depth_swapchain.images()[depth_image_index];
vk::Image depth_image = depth_swapchain.image(depth_image_index);
depth_swapchain.wait();
return {depth_swapchain, depth_image};
}
+4
View File
@@ -75,6 +75,10 @@ public:
{
return images_;
}
vk::Image image(size_t i) const
{
return images_[i];
}
vk::Format format() const
{
return format_;