llvm / llvm/offload-test-suite

[SPIRV][DirectX] Add multiple viewports support

Open
#1,051 0 comments 0 reactions 1 assignee View on GitHub

@Icohedron is already working on this.

Since Aug 19, 2026.

Dominant language
C++
Stars
18
Forks
39
Avg merge
2d 18h
Merged PRs (30d)
40

Description

Required for testing of `SV_ViewportArrayIndex` written from a vertex shader. A vertex shader may select a viewport per triangle from a vertex attribute.

Current Status: Both backends hardcode a single viewport derived from the render target dimensions, and `Encoder::setViewport`/`setScissor` take a single value.

Vulkan already queries `multiViewport` and `shaderOutputViewportIndex` but enables neither.

AC:
- [ ] Allow YAML test configuration to define multiple viewports (and matching scissor rects) under `Bindings`
- [ ] API: extend `Encoder::setViewports`/`setScissors` to take a list
- [ ] DX: issue `RSSetViewports`/`RSSetScissorRects` with the configured count
- [ ] DX: cabapility check of `VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation`
- [ ] VK: enable `multiViewport` and `shaderOutputViewportIndex` device features
- [ ] VK: issue `vkCmdSetViewport`/`vkCmdSetScissor` with the configured count
- [ ] VK: update `VkPipelineViewportStateCreateInfo` with viewport/scissor count
- [ ] Add lit feature for multi-viewport capability detection, set per backend as support lands
- [ ] Add testing by checking computed position of pixel shader through a UAV record

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.