refactor(TAA): name decompile constants and loop alpha coverage#85
refactor(TAA): name decompile constants and loop alpha coverage#85alandtse wants to merge 3 commits into
Conversation
PR community-shaders#2399 (upstream) replaced the high-level TAA implementation with a faithful SE decompile transcription, but dropped two VR-specific behaviors that Open Shaders' combined-eye render target depends on: 1. Per-eye reprojection. Vanilla VR renders eyes to separate targets, so plain texCoord+velocity is safe there; Open Shaders packs both eyes in one RT, so a pixel near the x=0.5 seam sampled the other eye's history (cross-eye ghosting). Restored Stereo::ApplyVelocityToUV plus the per-eye history clamp via GetPreviousDynamicResolutionAdjustedScreen- Position, and fed its mono-space out-of-bounds flag into the history reject (the stereo-space [0,1] test missed the seam). 2. Output alpha. The VR branch wrote colorOut.w = allTransparent ? 1 : 0, so opaque pixels (nearly the whole frame) got alpha 0. Restored the vanilla decompile behavior (o0.w = 1) on both editions. Both changes are guarded by #ifdef VR; the SE path is byte-identical. Validated with fxc ps_5_0 across flat / VR / HDR / VR+HDR permutations. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Condense the reprojection/reject why-comments per CLAUDE.md concise-comment guidance. Comment-only; compiled bytecode unchanged across all permutations.
Two behavior-preserving DRY cleanups on the decompile transcription: - Name the repeated magic literals (bracket caps 1.001/-0.001, the luma epsilon, and the 20/100 motion-similarity scale) as kMaxLumaCap / kMinLumaCap / kLumaEpsilon / kSimilarityScale. - Collapse the eight near-identical AlphaCoverageMask gate lines into an unrolled loop over the tap UVs. Compiled bytecode is byte-identical to the prior revision across all four permutations (flat / VR / HDR / VR+HDR), so this is purely cosmetic. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
No actionable suggestions for changed features. |
Behavior-preserving DRY cleanup on the TAA decompile transcription. Stacked on #84 — base will auto-retarget to
devonce #84 merges.Changes
kMaxLumaCap(1.001 bracket ceiling),kMinLumaCap(-0.001 floor),kLumaEpsilon(0.00999…),kSimilarityScale(float2(20,100)motion-diff decay). Each appeared 2–4× inline.AlphaCoverageMask(...) ? x : 0gate lines collapse into one unrolled loop over the tap UVs.Safety
Compiled
fxc ps_5_0bytecode is byte-identical (SHA-256) to the pre-refactor revision across all four permutations — flat / VR / HDR / VR+HDR. Purely cosmetic; no math change.Note
This diverges from upstream's exact transcription, so it adds (small) future sync friction. Kept intentionally minimal — only genuine repeated-literal DRY and the obvious loop. Larger readability work would be better contributed upstream.
🤖 Generated with Claude Code