OverviewFilesCommitsIssuesDocsReleasesPeers

nvidia-rtx-godot commits / f527094

Revert "Fix BLAS creation failing for every indexed mesh in release builds"
This reverts commit 736076e5c15e3efd4dc3e4e33138a533a16a2988.
f527094717f1310cfb9d14b4ea8897bdcf5ce96b
by plankatron <fleeky@gmail.com> · 2026-07-28T23:27:32.000Z

Changed files (1) +3 -19

servers/rendering/rendering_device.cpp +3 -19
……@@ -33,7 +33,6 @@
3333
3434#include "core/config/engine.h"
3535#include "core/config/project_settings.h"
36#include "core/error/error_backtrace.h"
3736#include "core/io/dir_access.h"
3837#include "core/io/file_access.h"
3938#include "core/object/class_db.h"
……@@ -359,16 +358,7 @@ RID RenderingDevice::blas_create(Span<AccelerationStructureGeometry> p_geometrie
359358
360359 uint32_t index_stride = (index_buffer->format == INDEX_BUFFER_FORMAT_UINT32 ? sizeof(uint32_t) : sizeof(uint16_t));
361360 ERR_FAIL_COND_V_MSG((t_in.index_offset + t_in.index_count * index_stride) > index_buffer->size, RID(), "The specified index offset and count are outside the range of the index buffer.");
362 // max_index is a DEBUG-ONLY diagnostic. index_buffer_create only scans
363 // the data under DEBUG_ENABLED, and sets 0xFFFFFFFF as an "unknown"
364 // sentinel both in release builds and whenever a buffer is created
365 // without initial data. Asserting on it unconditionally therefore
366 // failed EVERY indexed mesh in a template_release build
367 // (0xFFFFFFFF >= vertex_count is always true), so no BLAS was ever
368 // built, the TLAS was empty, and raytracing_list_bind_uniform_set
369 // then crashed on a null uniform set. Skip the check when the value
370 // is the sentinel — it stays a real guard wherever it is real data.
371 ERR_FAIL_COND_V_MSG(index_buffer->max_index != 0xFFFFFFFF && index_buffer->max_index >= t_in.vertex_count, RID(), "The index buffer contains an index that is outside the specified vertex range.");
361 ERR_FAIL_COND_V_MSG(index_buffer->max_index >= t_in.vertex_count, RID(), "The index buffer contains an index that is outside the specified vertex range.");
372362
373363 t_out.index_buffer = index_buffer->driver_id;
374364 t_out.index_offset = t_in.index_offset;
……@@ -7858,16 +7848,10 @@ void RenderingDevice::_free_internal(RID p_id) {
78587848 frames[frame].buffers_to_dispose_of.push_back(*hit_sbt);
78597849 hit_sbt_owner.free(p_id);
78607850 } else {
7861 static int trace_count = 0;
7862 String trace_suffix;
7863 if (trace_count < 20) {
7864 trace_count++;
7865 trace_suffix = "\n" + backtrace_dump() + " [trace " + itos(trace_count) + "/20]";
7866 }
78677851#ifdef DEV_ENABLED
7868 ERR_PRINT("Attempted to free invalid ID: " + itos(p_id.get_id()) + " " + resource_name + trace_suffix);
7852 ERR_PRINT("Attempted to free invalid ID: " + itos(p_id.get_id()) + " " + resource_name);
78697853#else
7870 ERR_PRINT("Attempted to free invalid ID: " + itos(p_id.get_id()) + trace_suffix);
7854 ERR_PRINT("Attempted to free invalid ID: " + itos(p_id.get_id()));
78717855#endif
78727856 }
78737857