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