D3D12.X: texture read-backs as PNG images #2422
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2432"
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?
Imported from ivall/xcl. Originally posted by madaraXor on 2026-11-25T18:38:07Z.
Texture read-backs as pictures, for
xcl replay(next PRs), which shows what a captured draw wrote. Part of #675.Stacked on #2431; only the top commit belongs here.
What is in it
gpu/texel_image.rs: the texels of the common DXGI formats as numbers (8 / 16 / 32-bit UNORM, UINT and float, 10:10:10:2, 11:11:10 float, the depth planes); an RGB image of a read-back (UNORM as it is, float and integer formats scaled by their largest finite value and square-rooted, the slices of a 3D texture side by side) with each channel's least and largest value; that image as a PNG (miniz_oxide, already a dependency).main; the per-subresource state fix of the review lives in #2430 / #2431.Tested
cargo test --workspace --no-fail-fast -- --test-threads=4on47447e4: 1434 passed, 5 failed, 46 ignored. The failures:gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1(seed 540),hle::kernelx::tests::xmem_virtual_query_marks_cpu_readable_memory(#650) and the e2e teststest_title_runs_and_game_folder_is_untouched,test_title_draws_with_a_root_signature_under_the_debug_layerandtest_title_runs_under_the_debug_layer_with_dred, which fail onmaine1d84b7on this machine too (its whole suite: 1416 passed, 7 failed, 46 ignored). SKIPPED: the six per-lane cases off16_programs_on_the_gpu/f32_programs_on_the_gpu(refused),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows)Regression run
scripts/smoke.ps1, 60 s, release builds, the same title on the same day.main:
PR:
Not tested
AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-25T19:46:20Z.
gpu_suite (cold cache): 160 passed / 4 failed, no crashes. Three are the known baseline trio on this lane; the fourth isgpu_promoted_uav_clear_values_pass_create_committed_resource, newly red on main since #2280 (report), unrelated to this PR.Targeted run of the new read-back tests (manifest, CRC32-vs-PNG, float/int scaling and 3D slice tiling): 3 passed.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T20:04:34Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.Thanks!
Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T20:28:31Z.
Review: COMMENTED
P1: capture state tracking is per resource, but normal barriers are per subresource. capture.rs:247-261 drops the subresource, and list_x.rs:4040-4048 passes b[6] while discarding b[4]. The snapshot helper later emits ALL_SUBRESOURCES with one recorded StateBefore (list_x.rs:111-124). After a valid transition of only one mip/slice, capture can therefore issue an invalid all-subresource transition for other slices, causing debug-layer errors or incorrect GPU state when capture is enabled. Track state per subresource, or decline capture after a partial transition unless complete states are known.
Imported from ivall/xcl. Originally posted by madaraXor on 2026-11-25T23:43:49Z.
Thanks. The per-subresource state point is fixed where it lives:
This PR only reads back what #2431 copied, so it gets that behaviour unchanged. The stack is rebased on current
main(with #2420), and the description has the new suite counts and smoke blocks.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T02:12:29Z.
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
upstream-sync referenced this pull request2026-11-26 05:05:05 +00:00
xcl nvprofileputs xcl.exe in an NVIDIA profile with a bigger shader heap (#2403) #2580Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:03:34Z.
Triage (#1607) – head
47447e4This PR is stacked on #2431; only the top commit (
gpu/texel_image.rs) belongs here. It overlaps with #2433-#2435 only because they are the same stack.Main already has a small PNG writer with its own CRC32 (
png_squareinhle/xgameruntime/api.rs, plus a test-only one inrecomp/tests.rs). This PR adds a third copy; sharing one encoder would avoid that. No correctness problems found.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View 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.