Skip to content

D3D12.X: a single-plane PresentX with a source sub-rectangle is scaled from it - #3293

Closed
Foniass wants to merge 1 commit into
xcl-dev:mainfrom
Foniass:d3d12x-presentx-subrect
Closed

Foniass wants to merge 1 commit into
xcl-dev:mainfrom
Foniass:d3d12x-presentx-subrect

Conversation

@Foniass

@Foniass Foniass commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

PresentX took the composing path, which scales each plane's source
rectangle to the window, only for several planes. A single plane was
copied 1:1 from its top-left corner, clipped to the window
(CopyTextureRegion), whatever its source rectangle: with dynamic
resolution (a 1600x900 region of a 3840x2160 target) in a 1280x720
window, only the region's top-left 1280x720 pixels showed, unscaled. A
single plane whose source is a strict sub-rectangle now goes the
composing path too; a whole-plane source keeps the copy.

Ported from amd-dev 48cf713 (its present.rs part), raylitebull.

What is in it

  • crates/xcl/src/hle/d3d12x/present.rs: uv_is_subrect; a single plane with a sub-rectangle source takes the composing path; test lines in the existing source-rect test

Tested

  • NVIDIA GeForce RTX 5070 Ti (driver 32.0.16.2114), AMD Ryzen 7 7800X3D, Windows 11 build 26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), debug tests, release smoke
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on aa5833d: 2604 passed, 4 failed, 49 ignored. The 4 failures are gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3 (E_OUTOFMEMORY from CreateComputePipelineState, seeds 70 / 545 / 1019 / 1507), the same as on main on this machine; they pass on another RTX 5070 Ti. SKIPPED GPU tests: 44 notices, almost all no wave64.
  • Retail title: 60 s smoke run below (no device removal or crash, frames and peak commit within the limits).

Regression run

main:

xcl-smoke v1
commit: b10cc4c6766adc947c2054ada4a2af98be15108d
gpu: NVIDIA GeForce RTX 5070 Ti
title: 3cb1d8e0
seconds: 60
exit: 0x0
frames shown: 1565 (PresentX 1565)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16026 MB

this PR:

xcl-smoke v1
commit: aa5833dbabad9095ef334c7b1febda8639f4b4e5
gpu: NVIDIA GeForce RTX 5070 Ti
title: 3cb1d8e0
seconds: 60
exit: 0x0
frames shown: 1681 (PresentX 1681)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 17002 MB

Not tested

  • a title with dynamic resolution (the smoke title presents whole planes as far as I know; I did not check its source rectangles)
  • AMD GPUs

AI use

  • Claude Code with Claude Opus 5.5: ported this part of the amd-dev commit named above to main, wrote the commit message and this description, ran the tests and the smoke run.

🤖 Generated with Claude Code

…d from it

PresentX took the composing path, which scales each plane's source
rectangle to the window, only for several planes. A single plane was
copied 1:1 from its top-left corner, clipped to the window
(CopyTextureRegion), whatever its source rectangle: with dynamic
resolution (a 1600x900 region of a 3840x2160 target) in a 1280x720
window, only the region's top-left 1280x720 pixels showed, unscaled. A
single plane whose source is a strict sub-rectangle now goes the
composing path too; a whole-plane source keeps the copy.

Ported from amd-dev 48cf713 (its present.rs part), raylitebull.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added area:d3d12 D3D12.X runtime, command lists, resources, sparse memory gpu:amd Code is specific to AMD / RDNA / wave64 GPUs (scope tag; see needs:amd-test) labels Nov 29, 2026
@Foniass

Foniass commented Nov 29, 2026

Copy link
Copy Markdown
Contributor Author

Closing: main already does this. 3f4a129 (from #2418, "harden PresentX compositor and single-plane sub-rect scaling") sends a single plane with a sub-rectangle source through the compositor (needs_compositor), with a GPU test, so this PR's diff is now empty against main.

(Comment written with Claude Code, Claude Opus 5.5.)

@Foniass Foniass closed this Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:d3d12 D3D12.X runtime, command lists, resources, sparse memory gpu:amd Code is specific to AMD / RDNA / wave64 GPUs (scope tag; see needs:amd-test)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant