Skip to content

Implement view instancing/multi-view.#194

Merged
crud89 merged 7 commits intomainfrom
dev/view-instancing
Nov 5, 2025
Merged

Implement view instancing/multi-view.#194
crud89 merged 7 commits intomainfrom
dev/view-instancing

Conversation

@crud89
Copy link
Copy Markdown
Owner

@crud89 crud89 commented Nov 5, 2025

Describe the pull request

This PR adds support for view instancing/multi-view, which is particularly useful for stereoscopic rendering. Fundamentally, it allows to execute individual draw calls over multiple viewports/scissors and/or render targets. To use it, GraphicsDeviceFeatures::ViewInstancing must be enabled when creating the device. Afterwards, render passes can be created with an additional viewMask parameter. This mask is a bit set, that enables views starting with the least significant bit. Currently all implementations only support up to 4 view instances, but the engine itself does not enforce this limit direclty. As an example, the view mask 0b1111 would render to all 4 views, while view mask 0b1001 would only render into views 0 and 3. From the shader side, the current view can be accessed using the SV_ViewID semantic.

It is also possible to render into different render targets this way. This is done by outputting SV_RenderTargetArrayIndex from a pre-rasterization shader stage (i.e., vertex, geometry, tessellation or mesh). A similar semantic SV_ViewportArrayIndex is available to select the viewport and scissor (set by ICommandBuffer::setViewports and ICommandBuffer::setScissors).

Related issues

@crud89 crud89 added this to the Alpha #05 milestone Nov 5, 2025
@crud89 crud89 self-assigned this Nov 5, 2025
@crud89 crud89 added this to LiteFX Nov 5, 2025
@crud89 crud89 added Vulkan πŸŒ‹ The issue involves the Vulkan backend. DX12 ❎ The issue involves the DX12 backend. labels Nov 5, 2025
@crud89 crud89 moved this to In Progress in LiteFX Nov 5, 2025
@crud89 crud89 force-pushed the dev/view-instancing branch from 40350a4 to 8bff946 Compare November 5, 2025 17:47
@crud89
Copy link
Copy Markdown
Owner Author

crud89 commented Nov 5, 2025

Run: checks

@crud89 crud89 merged commit bce1ae5 into main Nov 5, 2025
9 checks passed
@crud89 crud89 deleted the dev/view-instancing branch November 5, 2025 18:35
@crud89 crud89 moved this from In Progress to v0.5.1 in LiteFX Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DX12 ❎ The issue involves the DX12 backend. Vulkan πŸŒ‹ The issue involves the Vulkan backend.

Projects

Status: v0.5.1

Development

Successfully merging this pull request may close these issues.

Add support for view instancing.

1 participant