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

Manually merged
github merged 5 commits from github-bot/gh-426 into gh-pr/426/base 2026-12-04 09:29:42 +00:00 AGit
Owner

@⁠Androtim on GitHub · 2026-12-04 07:59 UTC · original
Androtim:fix/w9a-indoor-visuals → main · +697 −243 · 9 files · 5 commits · merged 2026-12-04 09:27 UTC

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** on GitHub · 2026-12-04 07:59 UTC · [original](https://github.com/Androtim/MiniVI/pull/426) `Androtim:fix/w9a-indoor-visuals` → `main` · +697 −243 · 9 files · 5 commits · merged 2026-12-04 09:27 UTC ## 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**
Adapted GPL-3.0 upstream fixes onto MiniVI:

- ReTerryDavis/ReVIctory 2b910e0 (GPL-3.0): prevent ahead-of-list texture
  uploads from recording unpopulated/recycled CPU staging buffers into
  CopyTextureRegion, and re-queue descriptor slots via read_short when an
  ahead-of-list job is skipped or fails (fixes BC/grey texture artifacts).
- ReTerryDavis/ReVIctory fdc4843 (GPL-3.0, GPU & shader fixes only):
  * Linear 2D capture RT readback (resource, texback, host, list, draw):
    detect linear RGBA8/BGRA8 2D capture render targets outside
    write-combined pools, mark them written on RT bind / copy / resolve,
    support CopyMemoryToMemoryX GPU-to-CPU target readback, strip D3D12
    row-pitch padding on landing, land synchronously without late-wait
    deferral, and write through write_mapped for soft-paged aliases.
  * Shader conditional pixel color export (victory-shader/src/emit/lower.rs):
    allow a pixel shader color export prior to its done export when guarded
    by the same EXEC mask. (MiniVI already handles live-quad helper
    retention via VICTORY_KILL_CONTINUE; build.rs automatically updates the
    VICTORY_TRANSLATOR shader cache fingerprint.)
- Verified parity with tyr0nsur/Darner ad070f0 (PR #94, GPL-3.0):
  VICTORY_AMBIENT_ALPHA (default on) and Role::Alpha for
  CS_SpatialFilterAlpha are already present in ambient.rs/draw.rs from
  PR #420 with the enhanced bound_alpha pass.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-04 08:03:10 +00:00
Author
Owner

@⁠Androtim on GitHub · 2026-12-04 08:01 UTC · original

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.
**@⁠Androtim** on GitHub · 2026-12-04 08:01 UTC · [original](https://github.com/Androtim/MiniVI/pull/426#issuecomment-7405408839) 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.
github-bot changed target branch from main to gh-pr/426/base 2026-12-04 09:29:41 +00:00
github manually merged commit 666cefa03d into gh-pr/426/base 2026-12-04 09:29:42 +00:00
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/Androtim--MiniVI!426
No description provided.