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 -> onRenderComplete = { index, buffer ->
buffers[index] = buffer if (buffers[index] == null) {
if (--pending == 0) { buffers[index] = buffer
performanceMeasure.endFrame() if (--pending == 0) {
Window.requestAnimationFrame { performanceMeasure.endFrame()
displayBuffers(buffers) Window.requestAnimationFrame {
renderFrame() displayBuffers(buffers)
renderFrame()
}
} }
} }
} }