Skip to content

D3D12.X: exclude GPU-written textures from write-watch ranges - #3

Draft
RandomGithub12309 wants to merge 1 commit into
mainfrom
d3d12x/exclude-gpu-written-watch
Draft

RandomGithub12309 wants to merge 1 commit into
mainfrom
d3d12x/exclude-gpu-written-watch

Conversation

@RandomGithub12309

Copy link
Copy Markdown
Owner

Exclude gpu_written textures from write-watch ranges (cached_watch_ranges) and bump TEXTURES_GEN when note_gpu_write marks a texture as GPU-written.

refresh already skips e.gpu_written textures when deciding which textures to upload, but cached_watch_ranges still included their backing memory in the GetWriteWatch scan ranges, causing unnecessary page watch scans (and keeping WATCH_CACHE stale until an unrelated registration/release bumped TEXTURES_GEN).

(Parked as a draft PR on RandomGithub12309/xcl while #667 and #674 are in review upstream; rebase onto ivall/xcl:main and run the full workspace test suite + scripts/smoke.ps1 before opening upstream.)

What is in it

  • crates/xcl/src/hle/d3d12x/title_textures.rs: bump TEXTURES_GEN in note_gpu_write when e.gpu_written transitions to true, extract watched_texture_ranges filtering !e.gpu_written for cached_watch_ranges, and add note_gpu_write_bumps_generation_and_excludes_texture_from_watch_ranges.

Tested

  • Hardware: NVIDIA GeForce RTX 5050 Laptop GPU (driver 32.0.16.2114), Intel Core Ultra 7 255HX (20 cores), Windows 11 Build 26300, rustc 1.100.0 (0ef1bc386 2026-11-09) stable-x86_64-pc-windows-msvc (debug).
  • cargo test -p xcl --lib hle::d3d12x::title_textures -- --test-threads=4 --nocapture: 11 passed, 0 failed, 0 ignored (adapter printed SKIPPED placed_title_textures_share_vram_and_preserve_pixels: this adapter makes no reserved cube with mips on Intel(R) Graphics; note_gpu_write_bumps_generation_and_excludes_texture_from_watch_ranges passed).

Regression run

  • Pending: parked on fork branch (main baseline dd2ae9a already captured on this machine; run cargo test --workspace -- --test-threads=4 and scripts/smoke.ps1 before submitting upstream to ivall/xcl).

Not tested

  • Full cargo test --workspace and scripts/smoke.ps1 on this standalone branch (deferred until ready to open upstream), AMD/Intel GPUs, Wine/Linux.

AI use

  • Antigravity with Gemini 4 Neon — wrote the change and unit test; test command executed on the hardware listed above.

title_textures::refresh skips textures with e.gpu_written == true during upload filtering, yet cached_watch_ranges still included their backing memory in GetWriteWatch scan ranges, and note_gpu_write did not bump TEXTURES_GEN.

Bump TEXTURES_GEN in note_gpu_write when e.gpu_written flips to true, filter !e.gpu_written entries when building watched_texture_ranges for cached_watch_ranges, and add a unit test.

Assisted-by: Antigravity (Gemini 4 Neon)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant