The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

comp: Fix OpenGL flipping of subimage coordinates

In the process of flipping OpenGL subimage coordinates (in accordance
with the specification of the XR_KHR_opengl_enable extension), Monado
was incorrectly assuming a subimage height of 1.0.

When the height of the subimage was reduced below 1.0 this was making
Monado clip the bottom instead of the top of the swapchain (as if the
origin was the top-left), and when the subimage Y offset was increased
Monado would show a black bar at the top where the coordinates went out
of range of the swapchain.

Fix this in both the compute and graphics compositor, effectively
replacing the assumed height of 1 with the original subimage height
before negation.

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2250>

+2 -2
+1 -1
src/xrt/compositor/util/comp_render_cs.c
··· 425 425 src_image_view = get_image_view(image, data->flags, array_index); 426 426 427 427 if (data->flip_y) { 428 + src_norm_rect.y += src_norm_rect.h; 428 429 src_norm_rect.h = -src_norm_rect.h; 429 - src_norm_rect.y = 1 + src_norm_rect.y; 430 430 } 431 431 432 432 // Fill in data.
+1 -1
src/xrt/compositor/util/comp_render_gfx.c
··· 774 774 const VkImageView src_image_view = get_image_view(image, data->flags, array_index); 775 775 776 776 if (data->flip_y) { 777 + src_norm_rect.y += src_norm_rect.h; 777 778 src_norm_rect.h = -src_norm_rect.h; 778 - src_norm_rect.y = 1 + src_norm_rect.y; 779 779 } 780 780 781 781 gfx_mesh_add_view( //