Skip to content

Commit 41365a0

Browse files
committed
Add checks for AS/ray query support in acceleration structure build paths
1 parent f5335e8 commit 41365a0

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

attachments/simple_engine/renderer.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,13 +732,17 @@ class Renderer
732732
*/
733733
void RequestAccelerationStructureBuild()
734734
{
735+
if (!accelerationStructureEnabled || !rayQueryEnabled)
736+
return;
735737
// Allow AS build to take longer than the watchdog threshold (large scenes in Debug).
736738
watchdogSuppressed.store(true, std::memory_order_relaxed);
737739
asBuildRequested.store(true, std::memory_order_release);
738740
}
739741
// Overload with reason tracking for diagnostics
740742
void RequestAccelerationStructureBuild(const char *reason)
741743
{
744+
if (!accelerationStructureEnabled || !rayQueryEnabled)
745+
return;
742746
if (reason)
743747
lastASBuildRequestReason = reason;
744748
else

attachments/simple_engine/renderer_rendering.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1473,7 +1473,16 @@ void Renderer::Render(const std::vector<Entity *> &entities, CameraComponent *ca
14731473
}
14741474
else
14751475
{
1476-
std::cout << "Failed to build acceleration structures, will retry next frame" << std::endl;
1476+
if (!accelerationStructureEnabled || !rayQueryEnabled)
1477+
{
1478+
// Permanent failure due to lack of support; do not retry.
1479+
asBuildRequested.store(false, std::memory_order_release);
1480+
watchdogSuppressed.store(false, std::memory_order_relaxed);
1481+
}
1482+
else
1483+
{
1484+
std::cout << "Failed to build acceleration structures, will retry next frame" << std::endl;
1485+
}
14771486
}
14781487
// Reset dev override after one use
14791488
asDevOverrideAllowRebuild = false;

0 commit comments

Comments
 (0)