fix(gpu/ambient,mirror): omit opaque/alpha CS_RayMiss sky bleed and add mirror ambient #273
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/273"
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 Androtim/MiniVI. Originally posted by Androtim on 2026-12-01T00:31:06Z.
Fixes indoor wood-floor sky bleed / frosted white reflection noise, reflection depth resource-state barriers, and dark mirror interiors when RT structures are unbuilt:
Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-01T01:03:58Z.
Automated triage for the maintainers (not an approval).
Verdict:
needs-gpu-test· CI (check):passingReview Summary
The implementation is clean, well-tested, and CI is passing. The changes touch HLSL shaders, default reflection/miss dispatch behavior, D3D12 resource-state transitions, and a new graphics pass for mirror views, so a local real-GPU smoke test is warranted before merging.
What Was Verified
CS_RayMissskip (crates/victory-gpu/src/draw.rs,crates/victory-gpu/src/ambient.rs):State::sky_miss_left_out/sky_miss_should_skipgates both direct (State::dispatch) and indirect (DISPATCH)CS_RayMissdispatches onMISS_OPAQUE | MISS_ALPHA, while preserving water reflections and automatically deferring when the RT structure builder orVICTORY_AMBIENT_SPECULARis active. Covered bysky_miss_skip_respects_builder_specular_and_kill_switch.without_depthfallback (crates/victory-gpu/src/draw.rs,crates/victory-gpu/src/ambient.rs): Depth SRVs recorded infound_viewsare transitioned viacrate::list::ensure_state(DEPTH_READ | SHADER_RESOURCEfor depth-stencil resources,SHADER_RESOURCEotherwise) beforeambient::after. TheBOUNDcompute shader (bound_lightwithRS_BOUND) matches its root constant/table/UAV layout inambient::without_depth, andState::dispatchinvalidateshost_pipelineandhost_roots[1]whenState::ambientreturnstrue.crates/victory-gpu/src/mirror.rs,crates/victory-gpu/src/pipeline.rs,crates/victory-gpu/src/draw.rs,crates/victory-gpu/src/lib.rs):mirror::partidentifiesps_generate_material_maskandps_mirror_volumetric_sky;State::mirror_colourcaptures the 2D 8-bit albedo texture (scoped per frame inCOLOUR_FALLBACKfor cross-list fallback), andmirror::lightvalidates matching 2D single-sample dimensions, resolves non-typeless RTV formats (resolve_rtv_format), transitionslit/colourstates, keeps all referenced resources on the list, and callsState::replayafterward.Minor Non-Blocking Notes
VICTORY_RAYMISS_KEEP=1andVICTORY_AMBIENT_SPECULAR_BOUND=1, whereas the code implements default-on behavior withVICTORY_RAYMISS_SKIP=0andVICTORY_AMBIENT_SPECULAR_BOUND=0kill-switches. Updating the PR body/release notes to match the actual env vars will avoid confusion.bound_light& mirrorcornerUAV reads:mirror.rsreadscells/pointsas root UAVs fromvs_5_1(corner), andambient::without_depthuses a separate root signature (RS_BOUND). Both compile cleanly in CI, but should be verified on real GPU hardware/drivers (including D3D12 debug layer if available) alongside visual inspection of indoor floors, water reflections, and mirrors.Generated with Antigravity CLI (
agy).Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-01T01:22:13Z.
A/B Visual & In-World Verification (
--features diagnostics, RTX 4060 Ti 8 GB, 1440p Series X, DLSS Performance, 45–60s)Verified across all 5 merged-stack runs (
overhaul-diag-x,isolate-1,isolate-2,isolate-indoor,isolate-qw) with 0 crashes and PNG visual inspection of both exterior sliding glass doors and the 60s walk to the living-room corner window:baseline-main: White/blue sky-bleed glare was visible on the indoor hardwood floor through the glass door.isolate-1/isolate-2/isolate-indoor/isolate-qw): Indoor sky-bleed glare is completely eliminated across both porch views and the 60s living-room window view (isolate-indoor), with natural interior lighting and[PASS]visual gates:isolate-1:[PASS]Visual (luma=111.05,near_black=1.86%,edge_energy=7.53,magenta=0.0%)isolate-2:[PASS]Visual (luma=109.88,near_black=0.78%,edge_energy=8.13,magenta=0.0%)isolate-indoor(60s walk to living-room window):[PASS]Visual (luma=86.56,near_black=1.25%,edge_energy=7.37,magenta=0.0%),6.0 fps(166.1 ms), VRAM6075 / 6399 MBisolate-qw:[PASS]Visual (luma=110.61,near_black=0.55%,edge_energy=6.97,magenta=0.0%),10.45 fps(95.95 ms), VRAM5687 / 6346 MBImported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-01T04:36:34Z.
Resolved all triage findings and policy items on
feat/iter273-indoor-lighting-and-mirror-ambient:State::sky_miss_left_outguard & default-on kill-switch (crates/victory-gpu/src/draw.rs,ambient.rs):VICTORY_RAYMISS_KEEPwith default-onVICTORY_RAYMISS_SKIP=0kill-switch only viasky_miss_should_skip(...).sky_miss_left_outwith!crate::pipeline::builder_runs() && !crate::ambient::specular_on(), so RT builder active orVICTORY_AMBIENT_SPECULARfallback paths executeCS_RayMissandambient::after/without_depthnormally.VICTORY_AMBIENT_SPECULAR_BOUNDto default-on (=0kill-switch only) viaparse_bound(...).ambient::tests::bound_fallback_defaults_on_with_zero_kill_switchanddraw::record_hash_tests::sky_miss_skip_respects_builder_specular_and_kill_switch.ambient::without_depth(crates/victory-gpu/src/ambient.rs):#ifdef BOUNDRS_BOUNDroot signature (RootConstants(17, b0), DescriptorTable(UAV(u0)), UAV(u1), UAV(u2)) and compiledbound_lightwith its ownID3D12RootSignature, eliminating the UAV-to-SRV (t0) descriptor mismatch.GATHEREDgating (crates/victory-gpu/src/mirror.rs,draw.rs):mirror::lightbefore emittingensure_statebarriers; retained bothtargetandsourcevialist.keep(...).resolve_rtv_format), rejecting0or*_TYPELESSformats when no typed RTV view format is provided (typeless_and_rtv_format_resolution).gatheredfromambient::around()intomirror::SOURCEso the 144-samplepointsloop only executes after points are gathered (falling back to the slow room mean otherwise).State.mirror_colourtracking as primary with aMutex<(usize, u64)>frame-scoped cross-list fallback (fallback_colour_is_frame_scoped), and bumpedVIEWSto1024.Paired 60s Plain
--releaseA/B (origin/maind79b9432vs PR #273)paired-main-release-60spaired-pr273-release-60smapped()stalls90s
--features diagnosticsVisual Verification (pr273-diag-90s)[PASS] Visual lighting & texture detail:pngs=24,lit=19/24, medianluma=98.22,near_black=0.02%,edge_energy=7.34,max_magenta=0.0%,crashes=0,no_host_texture_errors=0.frame-3996.png,frame-4036.png,frame-4068.png): crisp glass doors/blinds with zero sky-bleed glare, clean lighting and foliage, no artifacts.Verification
cargo +1.98.1-x86_64-pc-windows-gnu xtask policy(316 files ok)cargo +1.98.1-x86_64-pc-windows-gnu test --locked -p victory-gpu ambient:: -- --test-threads=1(15 passed; 0 failed; 1 ignored)cargo +1.98.1-x86_64-pc-windows-gnu test --locked -p victory-gpu mirror:: -- --test-threads=1(5 passed; 0 failed)cargo +1.98.1-x86_64-pc-windows-gnu test --locked -p victory-gpu sky_miss_skip -- --test-threads=1(1 passed; 0 failed)cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --locked -- -D warnings(default and--features diagnosticsclean)Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-01T05:19:53Z.
Maintainer review: CI passing on
503c4375,minivi-triageverified, default-on visual fix (=0kill-switches only) with paired 60s plain--releaseA/B showing zero overall perf regression (FPS 14.0 -> 14.25[+0.25],min FPS 2.1 -> 4.8,copyback -0.95 ms,VRAM -308 MBover=0 MB,uploaded +822,0crashes) and clean 90s--features diagnosticsvisual PNGs eliminating indoor sky-bleed glare. Approving and squash-merging.