Skip to content

Conversation

@bjornbytes
Copy link
Owner

@bjornbytes bjornbytes commented Oct 15, 2025

Adds support for quad views and mono view configurations in OpenXR, instead of assuming stereo.

Quad views render 4 views. The first 2 are low resolution stereo views. Views 3 and 4 are inset into the first 2, and have a smaller field of view (so a higher pixel density). It lets you have a higher PPD (either in the center of the display, or where the user is looking), but keep the periphery low resolution, reducing the total number of pixels shaded.

Adding support for quad views made it trivial to add support for mono views, so that is now supported as well.

I cheated a little bit here and require all the views to have the same resolution, which usually isn't the case in practice. The swapchain layers use the largest recommended size across all the views, but clamp it to the smallest max view size. This allows us to continue to use multiview to render all the views in a single pass. This could be improved in the future by using a per-view viewport, using either VK_EXT_shader_viewport_index_layer or VK_QCOM_multiview_per_view_viewports, but it's tricky since these aren't guaranteed to be supported (would need to patch SPIR-V bytecode I think).

Aside from the per-view viewport, another improvement would be a better Lua API for picking which view configuration you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants