Reduce rare generic object VBO upload race condition

This commit is contained in:
James Seibel
2026-06-01 21:44:59 -05:00
parent 299ab0f856
commit 9754943752
@@ -205,21 +205,20 @@ public class RenderableBoxGroup
this.vertexBufferContainer = this.altVertexBufferContainer; this.vertexBufferContainer = this.altVertexBufferContainer;
this.altVertexBufferContainer = temp; this.altVertexBufferContainer = temp;
this.vertexDataDirty = false;
return; return;
} }
// if the vertex data is already up to date, do nothing // executor should always be available, if not that probably means the level is being shut down
if (!this.vertexDataDirty) PriorityTaskPicker.Executor executor = ThreadPoolUtil.getRenderLoadingExecutor();
if (executor == null || executor.isTerminated())
{ {
return; return;
} }
PriorityTaskPicker.Executor executor = ThreadPoolUtil.getRenderLoadingExecutor(); // if the vertex data is already up to date, do nothing
if (executor == null || executor.isTerminated()) if (!this.vertexDataDirty)
{ {
return; return;
} }
@@ -250,6 +249,9 @@ public class RenderableBoxGroup
{ {
this.altVertexBufferContainer.updateVertexData(this.uploadBoxList); this.altVertexBufferContainer.updateVertexData(this.uploadBoxList);
this.altVertexBufferContainer.setState(IDhGenericObjectVertexBufferContainer.EState.READY_TO_UPLOAD); this.altVertexBufferContainer.setState(IDhGenericObjectVertexBufferContainer.EState.READY_TO_UPLOAD);
// upload complete
this.vertexDataDirty = false;
} }
catch (Exception e) catch (Exception e)
{ {