OverviewFilesCommitsIssuesDocsReleasesPeers

nvidia-rtx-godot commits / 7f82660

Skip the RT trace when the TLAS uniform set is unset
Restores d705ce59a5 (reverted in 3023ddc8c3, having never actually shipped -- 0.784.0's log reported custom_build.736076e5c, i.e. a template built without it) with a corrected premise. The original commit said build_tlas() returns nullptr "when p_render_data->rt_instances is empty". Source says otherwise: line 1531 is a null-POINTER check on the PagedArray, and build_acceleration_structures sizes the TLAS MAX(blass.size(), 1), so a valid TLAS is created even with zero instances. Emptiness is not the trigger. The reachable null paths are: - rt_instances is NULL. scene_features.rt is decided purely from the environment (_setup_rt: not a reflection probe + pathtracing_enabled + device support), and never consults rt_instances -- but RendererSceneCull::render_empty_scene() calls render_scene() without it. A PT-enabled scenario rendering an empty scene therefore reaches the dispatch block with rt_uniform_set null. - update_uniform_set() returns RID() on null rb_data, and bails via ERR_FAIL_COND_V if tlas creation failed. The dispatch block guarded neither, and bound the null set: ERROR: Parameter "uniform_set" is null. at: raytracing_list_bind_uniform_set taking the process down. The bindless set (index 1) already had exactly this guard, with a comment noting it can legitimately be unset; set 0 did not. On an empty-scene frame there is genuinely nothing to trace, so skipping is correct rather than a papering-over. ERR_PRINT_ONCE keeps it visible: if it fires on a frame that SHOULD have geometry, the trace is being skipped and the underlying question is still open. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
7f826607bb8c8a5f09bb452112912d623efcd5c9
by plankatron <fleeky@gmail.com> · 2026-07-29T14:05:42.000Z

Changed files (1) +18 -0

servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp +18 -0
……@@ -2524,6 +2524,24 @@ void RenderForwardClustered::_render_scene(RenderDataRD *p_render_data, const Co
25242524 ERR_PRINT_ONCE_ED("Failed to get raytracing pipeline. Aborting render.");
25252525 return;
25262526 }
2527 // Set 0 can legitimately be unset. scene_features.rt is decided purely from
2528 // the environment (see _setup_rt), but the TLAS build additionally requires
2529 // p_render_data->rt_instances to be non-null -- and render_empty_scene()
2530 // calls render_scene() without it, so a PT-enabled scenario with no camera
2531 // reaches here with rt_uniform_set null. update_uniform_set() can also
2532 // return an invalid RID (null rb_data, or tlas/uniform-set creation
2533 // failure). Binding null took the process down; skip the trace instead,
2534 // exactly as the bindless set below already does.
2535 //
2536 // There is nothing to trace on such a frame, so skipping is correct rather
2537 // than merely defensive -- but if this fires on a frame that SHOULD have
2538 // geometry, the trace is being skipped and the real question is why the
2539 // TLAS had no instances.
2540 if (!rt_uniform_set.is_valid()) {
2541 ERR_PRINT_ONCE("Raytracing: no TLAS uniform set for this frame - skipping the trace.");
2542 RD::get_singleton()->draw_command_end_label();
2543 return;
2544 }
25272545 RD::RaytracingListID raytracing_list = RD::get_singleton()->raytracing_list_begin();
25282546 RD::get_singleton()->raytracing_list_bind_raytracing_pipeline(raytracing_list, rt_pipeline);
25292547 RD::get_singleton()->raytracing_list_bind_uniform_set(raytracing_list, rt_uniform_set, 0);