Invalidate translated shaders after bank changes #793

Merged
klimovich008 merged 1 commit from codex/stamp-shader-bank into main 2026-11-08 23:16:59 +00:00
klimovich008 commented 2026-11-08 21:40:43 +00:00 (Migrated from github.com)

What this fixes

A build that changes only shader constant or storage-buffer bank handling can reuse translated shaders from the old code. vk_bank.cpp affects translation but is missing from the shader cache stamp.

Why merge

  • One-line change. Add the missing source to the existing stamp inputs.
  • Preserve the cache format, line-ending normalization, defaults and environment overrides.
  • Leave unrelated draw code outside the stamp; no runtime rendering path changes.

Change

  • nx2/build.py: include "vk_bank.cpp" in the explicit translator source tuple.
  • tests/test_shader_stamp_inputs.py: execute the production stamp block and check bank edits, unrelated draw edits and CRLF normalization.

Tested

  • python -I -B tests/run_all.py --jobs 1 --strict shader_stamp_inputs; checks the actual hash block using tiny temporary source files.
  • Fails on the old code, passes now: a bank-only edit leaves the old stamp unchanged and changes the fixed stamp.
  • Windows/Ryzen 7 5700X3D: the CPU-only regression and selected runner pass; no GPU is invoked.
  • CI: the new check passes on Windows/Linux. The suite fails test_mem_trim.py; the unchanged current base reproduces that failure, tracked in #799.

Not covered

  • This invalidates existing translated caches once, requiring preparation again.
  • No game or GPU run; this does not identify the cause of an existing visual defect.
## What this fixes A build that changes only shader constant or storage-buffer bank handling can reuse translated shaders from the old code. `vk_bank.cpp` affects translation but is missing from the shader cache stamp. ## Why merge - One-line change. Add the missing source to the existing stamp inputs. - Preserve the cache format, line-ending normalization, defaults and environment overrides. - Leave unrelated draw code outside the stamp; no runtime rendering path changes. ## Change - `nx2/build.py`: include `"vk_bank.cpp"` in the explicit translator source tuple. - `tests/test_shader_stamp_inputs.py`: execute the production stamp block and check bank edits, unrelated draw edits and CRLF normalization. ## Tested - `python -I -B tests/run_all.py --jobs 1 --strict shader_stamp_inputs`; checks the actual hash block using tiny temporary source files. - Fails on the old code, passes now: a bank-only edit leaves the old stamp unchanged and changes the fixed stamp. - Windows/Ryzen 7 5700X3D: the CPU-only regression and selected runner pass; no GPU is invoked. - CI: the new check passes on Windows/Linux. The suite fails `test_mem_trim.py`; the unchanged current base reproduces that failure, tracked in #799. ## Not covered - This invalidates existing translated caches once, requiring preparation again. - No game or GPU run; this does not identify the cause of an existing visual defect.
Commenting is not possible because the repository is archived.
No description provided.