leonida-shader: unpack 16-bit vertex inputs into the low half (SHADER-16BIT-VERTEX-INPUTS) #2592

Closed
Bloh09 wants to merge 1 commit from upstream-pr/2592 into main
Bloh09 commented 2026-11-28 22:11:19 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Bloh09 on 2026-11-28T22:11:19Z.


Claimed in the coordination issue as: SHADER-16BIT-VERTEX-INPUTS (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7246524754)

What and why

load_input in leonida-shader refused every 16-bit vertex input ("a 16-bit input"), so shaders that fetch half or 16-bit int attributes failed to translate. The host delivers these as 32-bit values; the console keeps them in the low half of the VGPR. Now float16 goes through legacyF32ToF16 and ints are masked with & 0xFFFF.

Skipped: packed 16-bit pairs.

Tested

Tested on Linux, no GPU, no game files: leonida-shader lib tests + policy check. The new test lowers a synthetic VS and asserts the ops (legacyF32ToF16 for float16, and 0xffff for ints); it fails on the old code. Untested on hardware.

GPUs tested: n/a

AI-assisted: yes (Grok Bot), reviewed by me.

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5545065864 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2592). Originally posted by [Bloh09](https://github.com/Bloh09) on 2026-11-28T22:11:19Z. --- Claimed in the coordination issue as: SHADER-16BIT-VERTEX-INPUTS (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7246524754) ### What and why `load_input` in leonida-shader refused every 16-bit vertex input ("a 16-bit input"), so shaders that fetch half or 16-bit int attributes failed to translate. The host delivers these as 32-bit values; the console keeps them in the low half of the VGPR. Now float16 goes through `legacyF32ToF16` and ints are masked with `& 0xFFFF`. Skipped: packed 16-bit pairs. ### Tested Tested on Linux, no GPU, no game files: leonida-shader lib tests + policy check. The new test lowers a synthetic VS and asserts the ops (`legacyF32ToF16` for float16, `and 0xffff` for ints); it fails on the old code. Untested on hardware. GPUs tested: n/a AI-assisted: yes (Grok Bot), reviewed by me. ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed.
Bloh09 commented 2026-11-28 22:41:47 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Bloh09 on 2026-11-28T22:41:47Z.


Closing for now to make room for the CI fix PR (repo allows one open PR); will reopen after.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246916358 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2592#issuecomment-7246916358). Originally posted by [Bloh09](https://github.com/Bloh09) on 2026-11-28T22:41:47Z. --- Closing for now to make room for the CI fix PR (repo allows one open PR); will reopen after.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
ProjectLeonida/mandy!2592
No description provided.