samples: fix rendering stopped when changing worker count or type

This commit is contained in:
Alexey Andreev 2023-11-25 14:05:01 +01:00
parent 2bd76e2da5
commit f3bf9d812f
2 changed files with 2852 additions and 6 deletions

File diff suppressed because it is too large Load Diff

View File

@ -102,12 +102,14 @@ class Controller(
})
}
onRenderComplete = { index, buffer ->
buffers[index] = buffer
if (--pending == 0) {
performanceMeasure.endFrame()
Window.requestAnimationFrame {
displayBuffers(buffers)
renderFrame()
if (buffers[index] == null) {
buffers[index] = buffer
if (--pending == 0) {
performanceMeasure.endFrame()
Window.requestAnimationFrame {
displayBuffers(buffers)
renderFrame()
}
}
}
}