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

Closed
leonida/mandy
Bloh09 wants to merge 0 commits from bloh09/shader-16bit-vertex-inputs into main

Pull request closed

This pull request cannot be reopened because the branch was deleted.

Bloh09 commented 2026-11-28 22:11:19 +00:00

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.
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

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

Closing for now to make room for the CI fix PR (repo allows one open PR); will reopen after.
Sign in to join this conversation.
No description provided.