diff --git a/.github/workflows/patch-v36-retail-soft.yml b/.github/workflows/patch-v36-retail-soft.yml index 1e72fce..e7991a4 100644 --- a/.github/workflows/patch-v36-retail-soft.yml +++ b/.github/workflows/patch-v36-retail-soft.yml @@ -10,18 +10,21 @@ permissions: jobs: patch: - if: github.event.head_commit.message != 'V36: soft Retail-style JFA decode' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: ref: test/v36-retail-jfa-soft - name: Apply conservative V36 decode patch - shell: python + shell: bash run: | + set -euo pipefail + python3 <<'PY' from pathlib import Path p = Path('src/outline/d3d9_hook.zig') s = p.read_text() + if 'V36 RETAIL-SOFT' in s: + raise SystemExit(0) old = '''/// V32 POLISH: hard 3px outline, no feather. /// c0 = (screen_width, screen_height, radius_px=3, 0). @@ -57,28 +60,21 @@ const jfa_decode_src = /// Uses the same two texture reads as V34: no 17-tap full-screen morphology. const jfa_decode_src = "ps_3_0\\n" ++ - // c1 = zero, halo alpha, core alpha, -interior threshold "def c1, 0.0, 0.22, 0.82, -0.002\\n" ++ - // pale Retail-like yellow/green target colour "def c2, 1.0, 0.95, 0.58, 0.0\\n" ++ "dcl_2d s0\\n" ++ "dcl_2d s1\\n" ++ "dcl_texcoord0 v0\\n" ++ - // Nearest JFA seed and pixel-space squared distance. "texld r0, v0, s0\\n" ++ "sub r1.xy, v0.xy, r0.xy\\n" ++ "mul r1.xy, r1.xy, c0.xy\\n" ++ "dp2add r1.z, r1, r1, c1.x\\n" ++ - // Squared core and halo radii. "mul r3.x, c0.z, c0.z\\n" ++ "mul r3.y, c0.w, c0.w\\n" ++ - // Outside halo => 0; inside halo => 0.22. "sub r4.x, r1.z, r3.y\\n" ++ "cmp r6.w, r4.x, c1.x, c1.y\\n" ++ - // Inside core => 0.82; otherwise keep halo alpha. "sub r4.x, r1.z, r3.x\\n" ++ "cmp r6.w, r4.x, r6.w, c1.z\\n" ++ - // Never paint over the original model interior. "texld r5, v0, s1\\n" ++ "add r5.x, r5.a, c1.w\\n" ++ "cmp r6.w, r5.x, c1.x, r6.w\\n" ++ @@ -97,10 +93,12 @@ const jfa_decode_src = raise SystemExit('Expected V34 decode constants not found') s = s.replace(old_cpu, new_cpu) p.write_text(s) + PY - name: Commit patch shell: bash run: | set -euo pipefail + if git diff --quiet; then exit 0; fi git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git add src/outline/d3d9_hook.zig