shaders: bound CBV row loads to 4096 rows and guard u32 wrap #660
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
hle
input
INTEL
lighting
linux-proton
memory
MULDER
needs-info
needs-logs
needs-rebase
NVIDIA
performance
post-merge
pr-diagnostics
pr-docs
pre-merge
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
relevance
high
relevance
low
relevance
medium
relevance
very-high
rendering
report
roadmap-proposal
saves
series-s
shaders
startup
status
blocked-by-rework
status
needs-test-report
status
needs-triage
status
ready-for-review
status
stale
status
superseded
status
wip
tools
ui
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TrustNo1/Darner!660
Loading…
Reference in a new issue
No description provided.
Delete branch "nyutt/merge-cbv-row-bounds"
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?
Contributor role (optional)
What it changes
Merge: read fromcrates/darner-shader/src/emit/lower.rs. Dynamic and constantcbufferLoadLegacy.i32loads do not clamp row indices to the 4,096 rows (64 KiB) a D3D12 CBV can hold, nor do they guard against 32-bit address wraparound (addr + 4*k), which can cause NVIDIA driverLDCdevice losses (DXGI_ERROR_DEVICE_REMOVED) when out-of-bounds reads hit row>= 4096or wrap back to row0.Port of PR #292 onto
Merge:DARNER_CB_ROWS(on by default;"0"disables) todarner_shader::SWITCHES(included in the shader cache key) andemit::shader::cb_rows_bounded().cbuffer_dwordwithcbuffer_dword_at,no_wrap, andcbuffer_dword_unless, clampingri <= 4095and returning0whenri > 4095oraddr + deltawraps pastu32::MAX.s_load_dword*CBV loads similarly withsaturating_add/wrapping_add.How it was tested
25189ee(based onorigin/Merge28a9b42)Merge.mainto fix NVIDIALDCdevice losses).Merge(reversible viaDARNER_CB_ROWS=0).cargo test -p darner-shader --lib --locked-> compiles and passes (0 testsindarner-shader --lib)cargo clippy -p darner-shader --all-targets --locked-> 0 new warnings inlib.rs,shader.rs, orlower.rsInvalid Constant Address LDC; general 32-bit wrap safety.darner-shader --libonMerge; needs in-game RTX verification.Checklist
Merge).Merge.Checked for overlap
[pr-fix][shaders][NVIDIA] shaders: bound CBV row loads to 4096 rows and guard u32 wrapto shaders: bound CBV row loads to 4096 rows and guard u32 wrapView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.