From 18d1619d200677e5ab163986834acb191a3dcc5c Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Sun, 8 Jun 2025 17:57:59 +0200 Subject: [PATCH] Don't crash on bigger than recommended image --- client/scenes/stream.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/scenes/stream.cpp b/client/scenes/stream.cpp index 1f64c129..fdca2bf9 100644 --- a/client/scenes/stream.cpp +++ b/client/scenes/stream.cpp @@ -882,6 +882,13 @@ void scenes::stream::render(const XrFrameState & frame_state) // defoveate the image auto extents = reprojector->reproject(command_buffer, foveation, image_index); + for (size_t i = 0; i < view_count; ++i) + { + extents[i] = { + .width = std::min(extents[i].width, swapchain.width()), + .height = std::min(extents[i].height, swapchain.height()), + }; + } command_buffer.writeTimestamp(vk::PipelineStageFlagBits::eBottomOfPipe, *query_pool, 2);