mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:50:51 +01:00
[PR #505] VS-INPUT-SIGNATURE: select shared-hash vertex shaders by container signature #553
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#553
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/505
Author: @bobcatchris
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:vertex-input-signature📝 Commits (1)
bdc06d4d3d12: select shared-hash vertex shaders by container signature📊 Changes
4 files changed (+112 additions, -5 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+6 -0)📝
runtime/shims/d3d12_vulkan_device.cpp(+4 -3)📝
runtime/src/shader_library.h(+49 -2)📝
runtime/test/shader_library_test.cpp(+53 -0)📄 Description
Claimed in the coordination issue as: VS-INPUT-SIGNATURE
What and why
Two vertex shader containers can contain the same native program and the same semantic names while assigning POSITION and COLOR to different registers. The first entry in the shader index can then bind a translation whose input signature does not match the pipeline's input layout, and the draw produces the wrong result or nothing at all.
This records the ISG1 mask and rw_mask fields that
shader_meta.pyalready emits, compares the PSO bytecode's ISG1 signature against shared-hash candidates, and keeps the existing layout-based fallback when the index has no complete match. It changes shader selection only where several candidates share a hash.Carried from the source patch:
github.com/Sigtryggur-Mani-Gudmundsson/graphics-runtime-patches@33ab48d3ea/README.md (vertex-shader-selection-for-programs-with-shared-hashes)No game data, keys, or decryption are included.
Tested
shader_library_testfromruntimewith CMake/Ninja, RelWithDebInfo: OKmainbecause the 3-argumentcandidates()API and signature comparison are absent; they pass with this change.python -I tests/test_docs_links.py— OKpython -I tests/test_docs_cli_flags.py— OKpython -I tests/test_ci_registration.py— OKpython -m compileall -q tools tests— OKgit diff --checkcleanThe source report measured a synthetic 64x64 Vulkan draw on an RTX 4070 Ti: the original lookup left all 4096 pixels at the clear color, while matching input signatures produced the expected output. 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
mainand merges cleanly.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
latencyframes in flight while armed (mailbox replace) #712