fix(gpu,shader): port Wave 9A texture upload, linear RT readback, and export fixes #426

Merged
Androtim merged 5 commits from upstream-pr/426 into main 2026-12-04 09:27:58 +00:00
Androtim commented 2026-12-04 07:59:03 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-04T07:59:03Z.


Summary (Wave 9A: Indoor Lighting, Texture & Shader Visual Fixes)

Ports and adapts the applicable GPU and shader fixes from three verified GPL-3.0 upstream commits onto MiniVI without regressing existing MiniVI features (PR #420 ound_alpha, PR #423 descriptor mirroring, Wave 7B placed-view eviction, or VICTORY_KILL_CONTINUE):

  1. ** yr0nsur/Darner d070f0 (PR #94, GPL-3.0) — Indoor particle & dust light bounded (VICTORY_AMBIENT_ALPHA)**

    • Verified full parity already present in crates/victory-gpu/src/ambient.rs and draw.rs from PR #420 (VICTORY_AMBIENT_ALPHA on by default, Role::Alpha for CS_SpatialFilterAlpha, ALPHA = (1, 24), enhanced ound_alpha compute shader, lpha_on() gating, and lpha_from / CS_VarianceFilterAlpha unit tests). Kept intact without regressing ound_alpha.
  2. ReTerryDavis/ReVIctory 2b910e0 (GPL-3.0) — BC/grey texture artifacts ( exture/ahead.rs)

    • Worker::copy() now requires job.upload.cpu().is_populated() before recording CopyTextureRegion (avoiding copying unpopulated/recycled CPU staging memory on first upload) and skips submitting an empty copy list when no jobs in the batch were populated.
    • inish() now calls crate::descriptor::host::read_short(job.staging.memory as u64) whenever an ahead-of-list upload is skipped or fails so descriptor slots re-queue for direct upload instead of remaining grey/black.
    • (ReVIctory-only modules not present in MiniVI — mbient/hlsl_ext.rs probe/light extensions, ram.rs, and ictory-loader/src/resolution.rs — are intentionally skipped.)
  3. ReTerryDavis/ReVIctory dc4843 (GPL-3.0) — GPU & shader fixes only

    • Linear 2D capture RT readback (
      esource.rs, shadow.rs, exback.rs, host.rs, list.rs, draw.rs):
      • Added
        esource::is_linear_2d_capture_rt (single-mip, single-slice, single-sample linear RGBA8/BGRA8 render targets outside write-combined pools) and
        esource::target_copy_at (live target lookup for CopyMemoryToMemoryX).
      • Added exback::packed_linear_size, pack_linear_rows, Target::new_to, and Back::is_packed_linear to strip D3D12 row-pitch padding, land through watch::writing + host::write_mapped for soft-paged GPU-alias addresses, and force synchronous submission in host::submit so CPU encoders never read stale zeros.
      • Marked linear 2D capture RTs written in draw.rs (RT bind) and list.rs (copy_resource, copy_texture_region,
        esolve), and wired CopyMemoryToMemoryX GPU-to-CPU target readback via HostList::texture_copy_to_memory.
    • Shader conditional pixel color export (crates/victory-shader/src/emit/lower.rs):
      • Allows a pixel shader color export prior to its done export when guarded by the same EXEC mask (same_as_done).
      • (MiniVI already implements live-quad helper retention via VICTORY_KILL_CONTINUE, which conflicts with ReVIctory's LIVE_QUADS scc_lane widening; keeping VICTORY_KILL_CONTINUE preserves _killed_pixel_stays_in_its_quad. MiniVI's crates/victory-gpu/build.rs automatically updates VICTORY_TRANSLATOR when ictory-shader/src changes.)
    • (Strictly skipped all ReVIctory launcher, overlay, UI, itle_cheats.rs, descriptor.rs eviction toggle, and ReVIctory-only ProbeRayMiss changes.)

Files Changed

  • crates/victory-gpu/src/texture/ahead.rs
  • crates/victory-gpu/src/resource.rs
  • crates/victory-gpu/src/shadow.rs
  • crates/victory-gpu/src/texback.rs
  • crates/victory-gpu/src/host.rs
  • crates/victory-gpu/src/list.rs
  • crates/victory-gpu/src/draw.rs
  • crates/victory-shader/src/emit/lower.rs

Verification

  • cargo +1.98.1-x86_64-pc-windows-gnu xtask policy — passed (sset policy: 365 files ok)
  • cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --locked -- -D warnings — passed (0 warnings)
  • cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --all-features --locked -- -D warnings — passed (0 warnings)
  • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader --lib a_killed_pixel_stays_in_its_quad --locked -- --test-threads=1 — 1 passed, 0 failed
  • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib texback::tests --locked -- --test-threads=1 — 7 passed, 0 failed (including new packed_linear_size and pack_linear_rows tests)
  • cargo +1.98.1-x86_64-pc-windows-gnu test -p xtask --locked — 8 passed, 0 failed
<!-- greyfinch-sync:Androtim/MiniVI:issue:5642678615 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/426). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-04T07:59:03Z. --- ## Summary (Wave 9A: Indoor Lighting, Texture & Shader Visual Fixes) Ports and adapts the applicable GPU and shader fixes from three verified GPL-3.0 upstream commits onto MiniVI without regressing existing MiniVI features (PR #420 ound_alpha, PR #423 descriptor mirroring, Wave 7B placed-view eviction, or VICTORY_KILL_CONTINUE): 1. ** yr0nsur/Darner d070f0 (PR #94, GPL-3.0) — Indoor particle & dust light bounded (VICTORY_AMBIENT_ALPHA)** - Verified full parity already present in crates/victory-gpu/src/ambient.rs and draw.rs from PR #420 (VICTORY_AMBIENT_ALPHA on by default, Role::Alpha for CS_SpatialFilterAlpha, ALPHA = (1, 24), enhanced ound_alpha compute shader, lpha_on() gating, and lpha_from / CS_VarianceFilterAlpha unit tests). Kept intact without regressing ound_alpha. 2. **ReTerryDavis/ReVIctory 2b910e0 (GPL-3.0) — BC/grey texture artifacts ( exture/ahead.rs)** - Worker::copy() now requires job.upload.cpu().is_populated() before recording CopyTextureRegion (avoiding copying unpopulated/recycled CPU staging memory on first upload) and skips submitting an empty copy list when no jobs in the batch were populated. - inish() now calls crate::descriptor::host::read_short(job.staging.memory as u64) whenever an ahead-of-list upload is skipped or fails so descriptor slots re-queue for direct upload instead of remaining grey/black. - *(ReVIctory-only modules not present in MiniVI — mbient/hlsl_ext.rs probe/light extensions, ram.rs, and ictory-loader/src/resolution.rs — are intentionally skipped.)* 3. **ReTerryDavis/ReVIctory dc4843 (GPL-3.0) — GPU & shader fixes only** - **Linear 2D capture RT readback** ( esource.rs, shadow.rs, exback.rs, host.rs, list.rs, draw.rs): - Added esource::is_linear_2d_capture_rt (single-mip, single-slice, single-sample linear RGBA8/BGRA8 render targets outside write-combined pools) and esource::target_copy_at (live target lookup for CopyMemoryToMemoryX). - Added exback::packed_linear_size, pack_linear_rows, Target::new_to, and Back::is_packed_linear to strip D3D12 row-pitch padding, land through watch::writing + host::write_mapped for soft-paged GPU-alias addresses, and force synchronous submission in host::submit so CPU encoders never read stale zeros. - Marked linear 2D capture RTs written in draw.rs (RT bind) and list.rs (copy_resource, copy_texture_region, esolve), and wired CopyMemoryToMemoryX GPU-to-CPU target readback via HostList::texture_copy_to_memory. - **Shader conditional pixel color export** (crates/victory-shader/src/emit/lower.rs): - Allows a pixel shader color export prior to its done export when guarded by the same EXEC mask (same_as_done). - *(MiniVI already implements live-quad helper retention via VICTORY_KILL_CONTINUE, which conflicts with ReVIctory's LIVE_QUADS scc_lane widening; keeping VICTORY_KILL_CONTINUE preserves _killed_pixel_stays_in_its_quad. MiniVI's crates/victory-gpu/build.rs automatically updates VICTORY_TRANSLATOR when ictory-shader/src changes.)* - *(Strictly skipped all ReVIctory launcher, overlay, UI, itle_cheats.rs, descriptor.rs eviction toggle, and ReVIctory-only ProbeRayMiss changes.)* ## Files Changed - crates/victory-gpu/src/texture/ahead.rs - crates/victory-gpu/src/resource.rs - crates/victory-gpu/src/shadow.rs - crates/victory-gpu/src/texback.rs - crates/victory-gpu/src/host.rs - crates/victory-gpu/src/list.rs - crates/victory-gpu/src/draw.rs - crates/victory-shader/src/emit/lower.rs ## Verification - cargo +1.98.1-x86_64-pc-windows-gnu xtask policy — **passed** (sset policy: 365 files ok) - cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --locked -- -D warnings — **passed** (0 warnings) - cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --all-features --locked -- -D warnings — **passed** (0 warnings) - cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader --lib a_killed_pixel_stays_in_its_quad --locked -- --test-threads=1 — **1 passed, 0 failed** - cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib texback::tests --locked -- --test-threads=1 — **7 passed, 0 failed** (including new packed_linear_size and pack_linear_rows tests) - cargo +1.98.1-x86_64-pc-windows-gnu test -p xtask --locked — **8 passed, 0 failed**
Androtim commented 2026-12-04 08:01:58 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-04T08:01:58Z.


Triage (8b5d82ee, CI IN_PROGRESS, MERGEABLE):

  • Clean, 100% title-neutral Wave 9A visual/texture/shader port (+451/-21 across 8 files, zero new env toggles): guards texture/ahead.rs against unpopulated CPU staging & re-queues skipped uploads via read_short(), adds linear 2D capture RT readback (texback.rs/resource.rs), and fixes shader live-quad export (emit/lower.rs).
  • Note: overlaps crates/victory-gpu/src/host.rs with #425 (whichever merges second will need a quick rebase).
  • Marked triage: needs gpu test — awaiting CI check PASS + Gate 2 Audit (#282) + Gate 3 plain---release & --features diagnostics PNG visual verification.
<!-- greyfinch-sync:Androtim/MiniVI:comment:7405408839 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/426#issuecomment-7405408839). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-04T08:01:58Z. --- Triage (`8b5d82ee`, CI `IN_PROGRESS`, `MERGEABLE`): - Clean, 100% title-neutral Wave 9A visual/texture/shader port (`+451/-21` across 8 files, **zero new env toggles**): guards `texture/ahead.rs` against unpopulated CPU staging & re-queues skipped uploads via `read_short()`, adds linear 2D capture RT readback (`texback.rs`/`resource.rs`), and fixes shader live-quad export (`emit/lower.rs`). - Note: overlaps `crates/victory-gpu/src/host.rs` with `#425` (whichever merges second will need a quick rebase). - Marked `triage: needs gpu test` — awaiting CI `check` PASS + Gate 2 Audit (`#282`) + Gate 3 plain-`--release` & `--features diagnostics` PNG visual verification.
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Androtim/MiniVI!426
No description provided.