| … | … | @@ -2524,6 +2524,24 @@ void RenderForwardClustered::_render_scene(RenderDataRD *p_render_data, const Co |
| 2524 | 2524 | ERR_PRINT_ONCE_ED("Failed to get raytracing pipeline. Aborting render."); |
| 2525 | 2525 | return; |
| 2526 | 2526 | } |
| 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 | } |
| 2527 | 2545 | RD::RaytracingListID raytracing_list = RD::get_singleton()->raytracing_list_begin(); |
| 2528 | 2546 | RD::get_singleton()->raytracing_list_bind_raytracing_pipeline(raytracing_list, rt_pipeline); |
| 2529 | 2547 | RD::get_singleton()->raytracing_list_bind_uniform_set(raytracing_list, rt_uniform_set, 0); |