| … | … | @@ -2524,6 +2524,19 @@ 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 be unset: build_tlas returns nullptr when p_render_data->rt_instances |
| 2528 | // is empty, and rt_uniform_set is only assigned when it succeeds — but this |
| 2529 | // dispatch block does not test for that, so it bound a null set and |
| 2530 | // raytracing_list_bind_uniform_set took the process down. Skip the frame |
| 2531 | // instead, exactly as the bindless set below already does. |
| 2532 | // |
| 2533 | // NOTE: this is a CRASH GUARD, not a fix. If it trips, path tracing renders |
| 2534 | // nothing that frame and the real question is why the TLAS had no instances. |
| 2535 | if (!rt_uniform_set.is_valid()) { |
| 2536 | ERR_PRINT_ONCE("Raytracing: no TLAS uniform set (empty rt_instances?) — skipping trace."); |
| 2537 | RD::get_singleton()->draw_command_end_label(); |
| 2538 | return; |
| 2539 | } |
| 2527 | 2540 | RD::RaytracingListID raytracing_list = RD::get_singleton()->raytracing_list_begin(); |
| 2528 | 2541 | RD::get_singleton()->raytracing_list_bind_raytracing_pipeline(raytracing_list, rt_pipeline); |
| 2529 | 2542 | RD::get_singleton()->raytracing_list_bind_uniform_set(raytracing_list, rt_uniform_set, 0); |