GPU: read DRED constant-view words without VirtualQuery #1344

Closed
github-bot wants to merge 1 commit from gh-pr/1344/head into gh-pr/1344/base
Owner

@⁠fuzeofficlal on GitHub · 2026-11-24 17:34 UTC · original
fuzeofficlal:perf/dred-notes-avoid-virtual-query-913 → main · +175 −4 · 1 files · 1 commits · closed without merging

Fixes #913.

Summary

  • Replace the per-draw texture::committed (VirtualQuery region walk) + raw unaligned read in draw::describe (#[cfg(feature = "diagnostics")]) with first_constant_words, reading 16 bytes directly via host::read_into (ReadProcessMemory) and decoding four little-endian f32 values without unsafe.
  • Preserves exact Constant({address:#x}, {size}) {words:?} formatting (including -0.0) while skipping null, reserved (MEM_RESERVE), or partially unmapped page boundaries without walking the process's memory regions on every draw/dispatch.

Verification

  • Added draw::tests::constant_view_notes_read_committed_words_and_skip_unmapped_pages testing unaligned committed f32 words, short buffers, null addresses, MEM_RESERVE pages, and cross-page committed/uncommitted boundaries:
    • NVIDIA GeForce RTX 5090 (VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1): passed (0 debug errors)
    • AMD Radeon(TM) Graphics (VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1): passed (0 debug errors)
    • Microsoft D3D12 WARP (VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1): passed (0 debug errors)
  • cargo clippy --workspace --all-targets --all-features and cargo xtask policy: passed.
**@⁠fuzeofficlal** on GitHub · 2026-11-24 17:34 UTC · [original](https://github.com/Marvisak/VIctory/pull/1344) `fuzeofficlal:perf/dred-notes-avoid-virtual-query-913` → `main` · +175 −4 · 1 files · 1 commits · closed without merging Fixes #913. ### Summary - Replace the per-draw `texture::committed` (`VirtualQuery` region walk) + raw unaligned read in `draw::describe` (`#[cfg(feature = "diagnostics")]`) with `first_constant_words`, reading 16 bytes directly via `host::read_into` (`ReadProcessMemory`) and decoding four little-endian `f32` values without `unsafe`. - Preserves exact `Constant({address:#x}, {size}) {words:?}` formatting (including `-0.0`) while skipping null, reserved (`MEM_RESERVE`), or partially unmapped page boundaries without walking the process's memory regions on every draw/dispatch. ### Verification - Added `draw::tests::constant_view_notes_read_committed_words_and_skip_unmapped_pages` testing unaligned committed `f32` words, short buffers, null addresses, `MEM_RESERVE` pages, and cross-page committed/uncommitted boundaries: - **NVIDIA GeForce RTX 5090** (`VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1`): passed (`0` debug errors) - **AMD Radeon(TM) Graphics** (`VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1`): passed (`0` debug errors) - **Microsoft D3D12 WARP** (`VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1`): passed (`0` debug errors) - `cargo clippy --workspace --all-targets --all-features` and `cargo xtask policy`: passed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:28:15 +00:00
github-bot closed this pull request 2026-11-26 04:28:15 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:37 UTC · original

Automated triage for the maintainers. Closing because this change is already in main, or main has since replaced the code it patches.

Main's describe() already reads the constant view's words through read_into without VirtualQuery (draw.rs, fixed today for the same per-draw cost).

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 00:37 UTC · [original](https://github.com/Marvisak/VIctory/pull/1344#issuecomment-7148712810) Automated triage for the maintainers. Closing because this change is already in `main`, or `main` has since replaced the code it patches. Main's describe() already reads the constant view's words through read_into without VirtualQuery (draw.rs, fixed today for the same per-draw cost). If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
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
github/Marvisak--VIctory!1344
No description provided.