fix(shader): keep killed pixel lanes in quad and fix wave32 lanes on Wave64 hosts #412
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/412"
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-03T23:45:40Z.
Summary
Fixes AMD RDNA 3/4 stippled/disappearing alpha-tested foliage, tree trunks, and per-pixel dither banding on 64-lane host waves:
Per-lane kill-continue demote (
VICTORY_KILL_CONTINUE, default on;=0to disable)victory-shader, pixel-shader lane branches whose one side ends in a quiet null-export kill block (exp null ... done+s_endpgm) withEXECprovably cleared (Some(Bool::FALSE)) now emitdx.op.discard(kill)and branch unconditionally to the live continuation block instead of exiting early (discard+ret).guards[to][i] == Some(Bool::FALSE)ondoneTarget::Nullexports inLower::kill_endand guardslive_okagainst!kill_end(b, live)inLower::exitso live depth-only / Z-prepass / UAV-onlyexp null doneexits are never misclassified as kill blocks.s_wqmwhole-quad helper-lane semantics so subsequent 2x2 quad swizzles and derivatives read valid computed values rather than undefined registers.VICTORY_KILL_CONTINUEtoTRANSLATOR_ENV_KEYSinvictory-gpu/src/shader_cache.rsso the shader cache keys on it.lobomfz/VIctory-xmem(SPDX GPL-3.0, PR #195, commit837007cfcfc602866f6bb06852f9408c1dc9ce89, mergef7bc339d8a6d7de8b148c20727e622cbc80c0bb0).Wave32 pixel/vertex lane indices and wide ballots on 64-lane host waves
v_mbcnt_lolane indices in0..31(and makesv_mbcnt_hia no-op) for wave32 pixel/vertex programs running in 64-lane host waves so per-pixel dither patterns do not saturate at 32 in the upper half of the wave.s_bcnt1_i32_b32,s_ff1_i32_b32,s_cmp_eq_u32,s_cmp_lg_u32, and ballot-backedv_mbcntto inspect both dwords of the 64-lane host ballot.lobomfz/VIctory-xmem(SPDX GPL-3.0, PR #344, commitse5243e48bfeca53a017e276749c1febd56eddc5aandf0fc9905ca1562e3d925a0b6978d1a280110c056, merge1152b9c24898c87f3274e888582ad5ddbf27d112).ReBAR VRAM reservation check
shadow::card_room_kept()invictory-gpuis already free of the +2.56 GiB phantom ReBAR reservation addressed inReTerryDavis/ReVIctory(SPDX GPL-3.0, commit631b2ed4f2c3e41b7115198913c857a9310389c7).Verification
cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader -- kill depth_only wave32(12 passed, includinga_killed_pixel_stays_in_its_quad,depth_only_live_null_exit_is_not_discarded,depth_only_alpha_test_inverted_compare_discards_only_killed_lanes, andwave32_pixel_lane_number_and_wide_ballot)cargo +1.98.1-x86_64-pc-windows-gnu check --workspace(clean)Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-04T00:02:24Z.
Triage (
e9c87557, CIcheckPASS):+529/-24, 3 files, zero opt-in toggles —VICTORY_KILL_CONTINUEis default-on with=0kill-switch; portslobomfz/VIctory-xmem#195Ř).#282):TRANSLATOR_ENV_KEYSaddsVICTORY_KILL_CONTINUE(which is unset by default), so existingSHADER_CACHE_VERSION = 3disk caches on AMD GPUs will NOT automatically re-translate previously cached pixel/vertex shaders unlessSHADER_CACHE_VERSIONis also bumped (3 -> 4) or the default key signature changes.#282) + Gate 3 cold-cache GPU verification (plain---releaseA/B +--features diagnosticsfoliage/tree/dither PNGs).