Skip to content

Commit 38330d1

Browse files
committed
fixed concurrent shape building
1 parent 507b3ce commit 38330d1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/kotlin/com/lambda/graphics/pipeline/VertexBuilder.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ package com.lambda.graphics.pipeline
2020
import com.lambda.graphics.buffer.DynamicByteBuffer
2121
import com.lambda.graphics.gl.Matrices
2222
import org.joml.Vector4d
23+
import java.util.concurrent.ConcurrentLinkedDeque
2324

2425
/**
2526
* A builder class for constructing vertex buffer objects (VBOs) with associated vertex attributes and indices.
@@ -29,8 +30,8 @@ import org.joml.Vector4d
2930
class VertexBuilder(
3031
private val direct: VertexPipeline? = null
3132
) {
32-
val vertices by lazy(LazyThreadSafetyMode.PUBLICATION) { mutableListOf<Attribute>() }
33-
val indices by lazy(LazyThreadSafetyMode.PUBLICATION) { mutableListOf<Int>() }
33+
val vertices = ConcurrentLinkedDeque<Attribute>()
34+
val indices = ConcurrentLinkedDeque<Int>()
3435

3536
private var verticesCounter = 0
3637

0 commit comments

Comments
 (0)