Guard the TLAS set with uniform_set_is_valid, not is_valid
The guard added in the previous commit used rt_uniform_set.is_valid(), which only
tests that the RID is non-zero. raytracing_list_bind_uniform_set fails on an
OWNER lookup instead:
UniformSet *uniform_set = uniform_set_owner.get_or_null(p_uniform_set);
ERR_FAIL_NULL(uniform_set);
so a stale RID -- one freed or externally invalidated since it was recorded --
sails through is_valid() and gets bound anyway. Observed in a PT run: the guard
was compiled in and never fired, yet
ERROR: Parameter "uniform_set" is null.
ERROR: Uniforms were never supplied for set (0) ...
still appeared twice, i.e. the trace dispatched with no set 0 bound.
uniform_set_is_valid() is the test that catches it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
d267b4af5f603f414165a02dbfb00537fa4b0339
by plankatron <fleeky@gmail.com> · 2026-07-29T14:15:54.000Z