Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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_layerorVK_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.