[PR #514] PS-INPUT-SIGNATURE: select pixel shaders by source container signature #560

Open
opened 2026-11-26 20:18:17 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/514
Author: @bobcatchris
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: pixel-input-signature


📝 Commits (2)

  • bdc06d4 d3d12: select shared-hash vertex shaders by container signature
  • 51444c8 Select pixel shader translations by the source container input signature

📊 Changes

6 files changed (+138 additions, -7 deletions)

View changed files

📝 docs/d3d12_vulkan.md (+12 -0)
📝 runtime/shims/d3d12_vulkan_device.cpp (+4 -3)
📝 runtime/src/shader_library.h (+52 -3)
📝 runtime/test/shader_library_test.cpp (+64 -0)
📝 tests/test_shader_meta.py (+5 -0)
📝 tools/shader_meta.py (+1 -1)

📄 Description

Claimed in the coordination issue as: PS-INPUT-SIGNATURE

Depends on: #505

What and why

Two containers can hold the same pixel program while declaring SV_Position differently: one uses depth, the other reciprocal W. The first entry in the shader index can then bind a translation whose position convention does not match the source container, turning a red draw black or the reverse.

This selects pixel shader translations by the source container's input signature. It follows #505, which introduces the shared signature-aware candidate selection used here.

Carried from the source patch:
github.com/Sigtryggur-Mani-Gudmundsson/graphics-runtime-patches@33ab48d3ea/README.md (pixel-shaders-with-the-same-program-and-different-position-inputs)

No game data, keys, or decryption are included.

Tested

  • Built and ran shader_library_test with the full two-commit stack: OK
  • python -I tests/test_shader_meta.py — OK
  • python -I tests/test_docs_links.py — OK
  • python -I tests/test_docs_cli_flags.py — OK
  • python -I tests/test_ci_registration.py — OK
  • python -m compileall -q tools tests — OK
  • pixel-only diff and full stack git diff --check clean
  • security sweeps: 0 hits

The source report measured the two cases on an RTX 4070 Ti: 4096 black pixels with the original lookup and 4096 red pixels after the fix for the reciprocal-W case, and the reverse for the depth case. I did not repeat that GPU measurement locally.

GPUs tested: n/a locally; source report used NVIDIA GeForce RTX 4070 Ti

AI-assisted: yes

Checklist

  • Based on current main plus the stated dependency and merges cleanly.
  • One topic; the dependency commit is #505.
  • No game data, keys or decryption.
  • Regression tests added for source-container pixel selection and shader metadata.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/514 **Author:** [@bobcatchris](https://github.com/bobcatchris) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `pixel-input-signature` --- ### 📝 Commits (2) - [`bdc06d4`](https://github.com/ubiquitarianism/leonida/commit/bdc06d4c790d70a90a3e933ed244d976d1b989fd) d3d12: select shared-hash vertex shaders by container signature - [`51444c8`](https://github.com/ubiquitarianism/leonida/commit/51444c8424a25547480643414ad4154cf1437e79) Select pixel shader translations by the source container input signature ### 📊 Changes **6 files changed** (+138 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_vulkan.md` (+12 -0) 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+4 -3) 📝 `runtime/src/shader_library.h` (+52 -3) 📝 `runtime/test/shader_library_test.cpp` (+64 -0) 📝 `tests/test_shader_meta.py` (+5 -0) 📝 `tools/shader_meta.py` (+1 -1) </details> ### 📄 Description Claimed in the coordination issue as: PS-INPUT-SIGNATURE Depends on: #505 ### What and why Two containers can hold the same pixel program while declaring `SV_Position` differently: one uses depth, the other reciprocal W. The first entry in the shader index can then bind a translation whose position convention does not match the source container, turning a red draw black or the reverse. This selects pixel shader translations by the source container's input signature. It follows #505, which introduces the shared signature-aware candidate selection used here. Carried from the source patch: https://github.com/Sigtryggur-Mani-Gudmundsson/graphics-runtime-patches/blob/33ab48d3ea90f9925351aeee8708181a71fb9634/README.md#pixel-shaders-with-the-same-program-and-different-position-inputs No game data, keys, or decryption are included. ### Tested - Built and ran `shader_library_test` with the full two-commit stack: OK - `python -I tests/test_shader_meta.py` — OK - `python -I tests/test_docs_links.py` — OK - `python -I tests/test_docs_cli_flags.py` — OK - `python -I tests/test_ci_registration.py` — OK - `python -m compileall -q tools tests` — OK - pixel-only diff and full stack `git diff --check` clean - security sweeps: 0 hits The source report measured the two cases on an RTX 4070 Ti: 4096 black pixels with the original lookup and 4096 red pixels after the fix for the reciprocal-W case, and the reverse for the depth case. I did not repeat that GPU measurement locally. GPUs tested: n/a locally; source report used NVIDIA GeForce RTX 4070 Ti AI-assisted: yes ### Checklist - [x] Based on current `main` plus the stated dependency and merges cleanly. - [x] One topic; the dependency commit is #505. - [x] No game data, keys or decryption. - [x] Regression tests added for source-container pixel selection and shader metadata. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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
starred/leonida#560
No description provided.