Repository navigation
allightmapblur_gl_test compares the dispatch with the fragment passes in single precision, past AMD's 8-bit export rounding - #554
Conversation
…nt passes' single precision, which AMD's 8-bit targets do not round as the store does On the RX 6800 (driver 26.8.1) the texel for texel case failed at every blur size and convention: about 4,200 of 94,357 pixels, 4.4%, where the dispatch's occlusion was exactly one 8-bit step above the fragment passes'. The driver hands a fragment shader's colour to an RGBA8 target at half precision, rounded toward zero, before rounding it to 8 bits: the light map held exactly that of the passes' single precision at all 84,337 drawn texels. The dispatch's rg8 store rounds the single precision itself to the nearest 8 bits. The two blurs agree; only the targets' rounding of them differed. The exact case's second pass now draws into a single-precision copy of the light map, seeded with its texels so the sky keeps them, and the dispatch's store must hold the 8 bits nearest it, or at a tie either of the two. One texel lay at 165.50002 steps, which the store rounded down. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Summary
Merge Risk: ⚪ Minimal · up to
|
Problem
allightmapblur_gl_test's "texel for texel through a single-precision scratch" case fails on an AMD RX 6800 (Windows, driver 26.8.1). It fails at every blur size and both depth conventions: about 4,200 of 94,357 pixels (4.4%) have the dispatch's occlusion exactly one 8-bit step above the fragment passes'.Cause
The driver doesn't round a fragment shader's colour straight to an RGBA8 target. It first hands it over at half precision, rounded toward zero, which drops a value just above a rounding midpoint below it. The dispatch's
rg8store rounds the single-precision value to the nearest 8 bits.I checked both with a temporary diagnostic:
unorm8(fp16_rtz(f))of the passes' single-precision value at all 84,337 drawn texels.The two blurs agree; only the targets' rounding of them differed. The viewer is unaffected beyond that rounding.
Change
blurFragment's second pass draws into a new single-precision copy of the light map,mFloatLight. It is seeded with the light map's texels so the sky keeps them.The comparison stays as sensitive to a difference in the blur's arithmetic as before: one shows wherever it moves the rounding. The other cases and
alcompute_gl_benchkeep the 8-bit targets.Testing
On the RX 6800:
allightmapblur_gl_testpasses, three runs in random order.alrender_gl_testspass.🤖 Generated with Claude Code