Skip to content

refactor(TAA): name decompile constants and loop alpha coverage#85

Closed
alandtse wants to merge 3 commits into
devfrom
refactor/taa-constants-alpha-loop
Closed

refactor(TAA): name decompile constants and loop alpha coverage#85
alandtse wants to merge 3 commits into
devfrom
refactor/taa-constants-alpha-loop

Conversation

@alandtse
Copy link
Copy Markdown
Owner

@alandtse alandtse commented Jun 3, 2026

Behavior-preserving DRY cleanup on the TAA decompile transcription. Stacked on #84 — base will auto-retarget to dev once #84 merges.

Changes

  • Named constants for the repeated magic literals: kMaxLumaCap (1.001 bracket ceiling), kMinLumaCap (-0.001 floor), kLumaEpsilon (0.00999…), kSimilarityScale (float2(20,100) motion-diff decay). Each appeared 2–4× inline.
  • Alpha-coverage loop: the eight near-identical AlphaCoverageMask(...) ? x : 0 gate lines collapse into one unrolled loop over the tap UVs.

Safety

Compiled fxc ps_5_0 bytecode 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

alandtse and others added 3 commits June 2, 2026 22:08
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>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 3, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ce6f8d0d-3bd6-4852-ac7b-20788460857a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/taa-constants-alpha-loop

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

No actionable suggestions for changed features.

@alandtse alandtse changed the base branch from fix/taa-vr-reprojection-alpha to dev June 3, 2026 06:13
@alandtse
Copy link
Copy Markdown
Owner Author

alandtse commented Jun 3, 2026

Folded into #90, which is stacked on this branch and already contains these commits (constants + alpha-loop). Consolidating the readability work into a single PR to cut review/bot overhead. Not deleting this branch since #90's history descends from it.

@alandtse alandtse closed this Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant