Skip to content

Commit c0956ab

Browse files
committed
fix thread safety with rendering frames and querying world bounds
1 parent 23e5d6b commit c0956ab

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

devices/rtx/frame/Frame.cu

+3-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ Frame::~Frame()
6262

6363
bool Frame::isValid() const
6464
{
65-
return m_renderer && m_renderer->isValid() && m_camera
66-
&& m_camera->isValid() && m_world && m_world->isValid();
65+
return m_renderer && m_renderer->isValid() && m_camera && m_camera->isValid()
66+
&& m_world && m_world->isValid();
6767
}
6868

6969
DeviceGlobalState *Frame::deviceState() const
@@ -204,6 +204,7 @@ void Frame::renderFrame()
204204
instrument::rangePop(); // flush array uploads
205205

206206
instrument::rangePush("rebuild BVHs");
207+
auto worldLock = m_world->scopeLockObject();
207208
m_world->rebuildWorld();
208209
instrument::rangePop(); // rebuild BVHs
209210
instrument::rangePop(); // update scene

0 commit comments

Comments
 (0)