Repository navigation
Water's default probe keeps its irradiance on AMD: one tap for probe 0 - #553
Merged
Merged
Conversation
…h AMD's compiler gave no irradiance under water's own On the RX 6800 (driver 26.8.1) reflectionprobe_gl_test failed only through sampleReflectionProbesWater, at REFMAP_LEVEL 3 with 3 probes a point: 1,630 ambient taps far darker than the list's, in 8x8 blocks, one a wave. They were exactly the 39 waves whose first pixel's list was full, so it skipped water's own `if (count < REF_SAMPLE_COUNT) probeTap(0, ...)`. Every other pixel of those waves that took the tap got none of the default probe's irradiance: many read exactly amblit * (1 - refParams[0].x), the mix of a zero irradiance. The automatic probes' tap of it under `automatic && count < REF_SAMPLE_COUNT` was right in all 343 waves whose first pixel skipped it. Water and the automatic probes now take probe 0 through that one tap, where the list has room and either the automatic probes are not shut out or the point is water's, and water mixes it in as an automatic probe after. Every entry point taps the same probes as before, at both probe levels, and the probe bench's times are unchanged. The viewer lists 32 probes a point, so its water met this only where 32 probes hold a pixel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters: 1
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
reflectionprobe_gl_testfails on an AMD RX 6800 (Windows, driver 26.8.1). It fails only throughsampleReflectionProbesWater, atREFMAP_LEVEL3 withREF_SAMPLE_COUNT3: 1,630 ambient taps come out far darker than the list's.Cause
The bad texels fall in 8×8 blocks, one GPU wave of 64 pixels each. They are exactly the 39 waves whose first pixel has a full list. That pixel skips water's own default-probe tap,
if (count < REF_SAMPLE_COUNT) probeTap(0, ...).Every other pixel of those waves that takes the tap gets none of probe 0's irradiance. Many read exactly
amblit * (1 - refParams[0].x), which is what a zero irradiance mixes to.The pixels' inputs are per-pixel hashes, and the shader has no cross-lane operations. So one pixel's branch changing another's result is the driver's compiler. The automatic probes' own tap of probe 0, under
automatic && count < REF_SAMPLE_COUNT, was right in all 343 waves whose first pixel skipped it.Change
sampleProbeTapstakes probe 0 through one tap for both cases. It taps where the list has room and either the automatic probes are not shut out or the point is water's:(automatic || t.water) && count < REF_SAMPLE_COUNT. Water then mixes it in as an automatic probe, as before.Every entry point taps the same probes in the same order as before, at both probe levels. This replaces three tap sites with one.
Viewer impact: the viewer lists 32 probes a point, so its water met this only where 32 probes hold a pixel. It would show as dark 8×8 blocks in the water's irradiance on AMD. I haven't looked for this in the viewer.
Testing
On the RX 6800:
reflectionprobe_gl_testpasses, three runs in random order.alrender_gl_testspass.reflectionprobe_gl_benchwith the old and new shader alternated in the same binary: every fused time is unchanged within noise. Level-3 water is 2.605 ms both ways, and the rest are within ±0.4%.🤖 Generated with Claude Code