Fix crash in 1.16 due to buffer upload happening before rendering is setup

This commit is contained in:
James Seibel
2024-04-03 07:19:34 -05:00
parent b59d505725
commit 750d8b7bc3
@@ -29,6 +29,7 @@ import com.seibel.distanthorizons.core.file.fullDatafile.FullDataSourceProviderV
import com.seibel.distanthorizons.core.level.IDhClientLevel;
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
import com.seibel.distanthorizons.core.pos.DhSectionPos;
import com.seibel.distanthorizons.core.render.glObject.GLProxy;
import com.seibel.distanthorizons.core.render.renderer.IDebugRenderable;
import com.seibel.distanthorizons.core.dataObjects.render.bufferBuilding.ColumnRenderBuffer;
import com.seibel.distanthorizons.core.render.renderer.DebugRenderer;
@@ -92,6 +93,13 @@ public class LodRenderSection implements IDebugRenderable, AutoCloseable
public void loadRenderSourceAsync()
{
if (!GLProxy.hasInstance())
{
// it's possible to try uploading buffers before the GLProxy has been initialized
// which would cause the system to crash
return;
}
if (this.renderSourceLoadingFuture != null)
{
return;