dynamic texture array: upload if thread is rendering thread

This commit is contained in:
Moritz Zwerger 2023-10-29 23:57:42 +01:00
parent 9e6a5f9188
commit 7a49d20e75
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -72,7 +72,11 @@ abstract class DynamicTextureArray(
val data = creator.invoke()
this.data = MipmapTextureData(data.size, data.buffer)
context.queue += { upload(index, this) }
if (Thread.currentThread() == context.thread) {
upload(index, this)
} else {
context.queue += { upload(index, this) }
}
}
fun pushRaw(identifier: Any, async: Boolean = true, creator: () -> ByteArray): DynamicTexture {