Gfx: Add support for Multiview (Multi Viewport)

Created on 14 Jul 2020  ·  3Comments  ·  Source: gfx-rs/gfx

From the Vulkan spec:

VK_KHR_multiview

This extension has the same goal as the OpenGL ES GL_OVR_multiview extension - it enables rendering to multiple “views” by recording a single set of commands to be executed with slightly different behavior for each view. It includes a concise way to declare a render pass with multiple views, and gives implementations freedom to render the views in the most efficient way possible.


I am not familiar with how/if other backend APIs provide the same functionality.

request average hal ready for work api feature high

All 3 comments

Thank you for filing this! Doing an actual investigation into the backend support would be the next step.

Multi-View Rendering is supposedly supported by DX12, DX11, Vulkan and OpenGL, as written on the related NVidia page. They also have a nice article about the feature.

Resources on the feature:

Thank you! The next would be adding a feature to gfx-hal Features, something like:

const MULTIVIEW = 0x2000_0000_0000_0000;

If you are interested in the full thing, may also add these:

const MULTIVIEW_GEOMETRY_SHADER = 0x4000_0000_0000_0000;
const MULTIVIEW_TESSELLATION_SHADER = 0x8000_0000_0000_0000;

This is sorta optional as WebGPU isn't going to be using those anyway. It's up to you to limit the scope here, we can always follow-up and add those too.

Then basically extend the Rust API in the way it's done by VK_KHR_multiview extension:

  • adding the limits
  • add view_mask: u32 field to SubpassDesc
  • add view_offset: u32 field to SubpassDependency
  • find some way to provide the correlation masks, maybe just as an argument to create_render_pass

Finally, implement the logic on all backends, or at least update them to compile (not exposing the feature yet).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Bastacyclop picture Bastacyclop  ·  3Comments

kvark picture kvark  ·  4Comments

Lokathor picture Lokathor  ·  4Comments

torkleyy picture torkleyy  ·  4Comments

mjadczak picture mjadczak  ·  4Comments