don't create shadow geometry GL objects right away

This commit is contained in:
DBotThePony 2023-02-05 00:56:09 +07:00
parent 6584087842
commit d7c16697be
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -207,9 +207,9 @@ class ClientChunk(world: ClientWorld, pos: ChunkPos) : Chunk<ClientWorld, Client
}
private inner class ShadowGeometryTracker(val x: Int, val y: Int) : GPULightRenderer.ShadowGeometryRenderer {
private val hardShadowGeometry = StatefulVertexBuilder(state, GPULightRenderer.SHADOW_FORMAT, GeometryType.LINES)
private val hardShadowGeometry by lazy(LazyThreadSafetyMode.NONE) { StatefulVertexBuilder(state, GPULightRenderer.SHADOW_FORMAT, GeometryType.LINES) }
private var hardShadowGeometryRev = -1
private val softShadowGeometry = StatefulVertexBuilder(state, GPULightRenderer.SHADOW_FORMAT_SOFT, GeometryType.QUADS_ALTERNATIVE)
private val softShadowGeometry by lazy(LazyThreadSafetyMode.NONE) { StatefulVertexBuilder(state, GPULightRenderer.SHADOW_FORMAT_SOFT, GeometryType.QUADS_ALTERNATIVE) }
private var softShadowGeometryRev = -1
private fun buildGeometry(builder: StatefulVertexBuilder, line: (StatefulVertexBuilder, Float, Float, Float, Float) -> Unit) {