Shaders: 16-bit vertex inputs are refused #1512

Open
opened 2026-11-26 04:34:36 +00:00 by github-bot · 3 comments
Owner

@⁠Bloh09 on GitHub · 2026-11-24 18:39 UTC · original

Shaders: 16-bit vertex inputs are refused

load_input returns "a 16-bit input" for a signature element with half set (the fetch shader's attributes). Pixel interpolation already unpacks 16-bit inputs to 32-bit host values; the vertex path does not.

The host signature already declares these 32-bit (SigElement.half). The fetch result on the console is the 16-bit value in the low half of the VGPR (one per dword). Packed (two per dword) is a later slice: VsInput has no pack flags.

Synthetic test, no game files.

**@⁠Bloh09** on GitHub · 2026-11-24 18:39 UTC · [original](https://github.com/Marvisak/VIctory/issues/1512) Shaders: 16-bit vertex inputs are refused `load_input` returns "a 16-bit input" for a signature element with `half` set (the fetch shader's attributes). Pixel interpolation already unpacks 16-bit inputs to 32-bit host values; the vertex path does not. The host signature already declares these 32-bit (`SigElement.half`). The fetch result on the console is the 16-bit value in the low half of the VGPR (one per dword). Packed (two per dword) is a later slice: `VsInput` has no pack flags. Synthetic test, no game files.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:34:36 +00:00
Author
Owner

@⁠Bloh09 on GitHub · 2026-11-24 18:39 UTC · original

Taking this, PR today.

**@⁠Bloh09** on GitHub · 2026-11-24 18:39 UTC · [original](https://github.com/Marvisak/VIctory/issues/1512#issuecomment-7140962909) Taking this, PR today.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 10:24 UTC · original

Automated triage for the maintainers.

In scope. On main (940d32f), load_input in crates/victory-shader/src/emit/lower.rs refuses a signature element with half set ("a 16-bit input"); its shortcut: note says vertex inputs are not unpacked while pixel inputs are. The change is open as PR #1519 from the same author, so review goes there.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 10:24 UTC · [original](https://github.com/Marvisak/VIctory/issues/1512#issuecomment-7159641114) <!-- victory-issue-triage v1 verdict=tracked seen=2026-11-24T18:39:53Z at=2026-11-25T09:50:38Z --> Automated triage for the maintainers. In scope. On `main` (`940d32f`), `load_input` in `crates/victory-shader/src/emit/lower.rs` refuses a signature element with `half` set ("a 16-bit input"); its `shortcut:` note says vertex inputs are not unpacked while pixel inputs are. The change is open as PR #1519 from the same author, so review goes there. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠pes7 on GitHub · 2026-11-26 15:22 UTC · original

Different 16-bit problem, same family — worth saying so that nobody waits on the wrong fix.

#2936 (b1ec6e0) widens the packed colour formats the host has no equivalent for: B5G6R5, B5G5R5A1, B4G4R4A4 → BGRA8 in pc_format, "the one function resources, views, twins and pipeline target formats all go through". The failure it fixed was a removal rather than a refusal: the device went away with DXGI_ERROR_INVALID_CALL on a typed UAV of B5G5R5A1 and on a B4G4R4A4 render target. With it, the title reaches gameplay (2 555 draws a frame).

That is a resource format widening. This issue — a 16-bit vertex input the translator refuses — is untouched by it: the vertex fetch path still has to unpack the 16-bit components into the attribute, and #1519 ("unpack 16-bit vertex inputs into the low half") and #1512's own scope are where that lives.

Related, also separate: #1946 (a null UAV for packed 16-bit formats D3D12 refuses) is the descriptor side of the packed-colour change and merges next to descriptor/host.rs rather than in it; #2636 decodes packed 16-bit UNORM diagnostic targets, which is how a widened target is read back for comparison.

So: packed colour formats are handled in #2936, packed vertex inputs here are still open.

**@⁠pes7** on GitHub · 2026-11-26 15:22 UTC · [original](https://github.com/Marvisak/VIctory/issues/1512#issuecomment-7196187925) Different 16-bit problem, same family — worth saying so that nobody waits on the wrong fix. #2936 (`b1ec6e0`) widens the **packed colour** formats the host has no equivalent for: `B5G6R5`, `B5G5R5A1`, `B4G4R4A4` → `BGRA8` in `pc_format`, "the one function resources, views, twins and pipeline target formats all go through". The failure it fixed was a removal rather than a refusal: the device went away with `DXGI_ERROR_INVALID_CALL` on a typed UAV of `B5G5R5A1` and on a `B4G4R4A4` render target. With it, the title reaches gameplay (2 555 draws a frame). That is a *resource format* widening. This issue — a 16-bit **vertex input** the translator refuses — is untouched by it: the vertex fetch path still has to unpack the 16-bit components into the attribute, and #1519 ("unpack 16-bit vertex inputs into the low half") and #1512's own scope are where that lives. Related, also separate: #1946 (a null UAV for packed 16-bit formats D3D12 refuses) is the descriptor side of the packed-colour change and merges next to `descriptor/host.rs` rather than in it; #2636 decodes packed 16-bit UNORM diagnostic targets, which is how a widened target is read back for comparison. So: packed *colour* formats are handled in #2936, packed *vertex inputs* here are still open.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory#1512
No description provided.