Shaders: vector buffer loads through a descriptor built around a table in the code #2916
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!2916
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2916"
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?
@Proudnoob4 on GitHub · 2026-11-29 18:48 UTC · original
Proudnoob4:pr/code-table-loads→main· +75 −0 · 2 files · 1 commits · openWhat it fixes
A vector buffer load through a descriptor built around the PC (
s_getpc_b64,s_add_u32of the table's offset, the descriptor ins[n:n+3]with num_records set, thenbuffer_load_dword ... offen) was refused insidehandle("a descriptor built around a table in the code"). A load has no effect of its own, so this did not refuse the program: it only left the loaded registers missing, the joins after it read 0, and nothing was logged. Scalar (smem) andglobal_loadreads of such tables were lowered already.Where it shows: the title's ACES tone-map table bake, in the form it hands to
DeserializeComputePipelineStateX(0x218), reads its spline coefficients this way. All 18 coefficient loads read 0 and the 32³ table it bakes came out one colour. The plain container of the same shader reads the table withglobal_load, so regular pipelines don't meet this.How
The load reads the table's dwords through
code_dword, as the scalar path does, with 0 at bytes past the descriptor's size (the console's range check). Stores, atomics, typed, sub-dword and indexed accesses through such a descriptor stay refused.Tested
a_vector_load_through_a_descriptor_built_around_a_table_in_the_code(hand-assembled GFX10; fails on main).VICTORY_DESERIALIZE_COMPUTE=1(RTX 4080 16 GB, 1440p, DLSS Quality; a build with this change and other open PRs): the scene is still grey. So this removes one cause, not the last one on that path, and the switch should stay off.cargo test -p victory-shader --lib --locked: 412 passed, 51 failed. Main gives 411 and the same 51 here, all for want of an SM 6.6 device (Windows 10, test binaries without the Agility SDK); none fails only with this change.crates/victory-loader/src/crash.rs:804(as on other open PRs, e.g. #2487), before it reaches this change.AI-assisted.
A constant table the compiler appends to the code is read through `s_getpc_b64`: scalar loads (`smem`, the `Source::Built { param: CODE }` case) and `global_load` (`flat`) of it were lowered from the table already, but a vector buffer load through a descriptor built around the PC (`s_getpc_b64`, `s_add_u32` of the table's offset, then `buffer_load_dword ... offen` through `s[n:n+3]` with num_records set) went to `handle`, which refused it ("a descriptor built around a table in the code"). A load has no effect of its own, so the refusal only left its registers missing and the joins after it read 0: the program still translated, wrong, and nothing was logged. The title's ACES tone-map table bake, in the form it hands to DeserializeComputePipelineStateX (0x218), reads its spline coefficients so: all 18 of its coefficient loads read 0, and every cell of the 32^3 table it bakes came out one colour. Its plain container's code reads the same table with `global_load`, which translated, so regular pipelines did not meet this. Now such loads read the table's dwords (`code_dword`), 0 at bytes past the descriptor's size as the console's range check gives; stores, atomics, typed, sub-dword and indexed accesses through one stay refused. Checked offline: the DXIL of that 0x218 program, run for six cells of the table by an interpreter beside the DXIL of its plain container, stored the same values in all six (before: one colour in every cell). Test: a_vector_load_through_a_descriptor_built_around_a_table_in_the_code (refused before).View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.