mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 09:25:38 +00:00
app,app/internal/gpu: process frame in parallel
A frame ops buffers is tracersed twice: once for GPU commands, and once for everything else. There is already a GPU goroutine for concurrentl issuing of GPU commands; move the frame ops processing to the goroutine as well. Both frame ops passed can then proceed in parallel. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+3
-1
@@ -122,7 +122,7 @@ func (w *Window) update(frame *op.Ops) {
|
||||
}
|
||||
|
||||
func (w *Window) draw(frameStart time.Time, size image.Point, frame *op.Ops) {
|
||||
w.gpu.Draw(w.queue.q.Profiling(), size, frame)
|
||||
sync := w.gpu.Draw(w.queue.q.Profiling(), size, frame)
|
||||
w.queue.q.Frame(frame)
|
||||
switch w.queue.q.TextInputState() {
|
||||
case input.TextInputOpen:
|
||||
@@ -141,6 +141,8 @@ func (w *Window) draw(frameStart time.Time, size image.Point, frame *op.Ops) {
|
||||
w.setNextFrame(t)
|
||||
}
|
||||
w.updateAnimation()
|
||||
// Wait for the GPU goroutine to finish processing frame.
|
||||
<-sync
|
||||
}
|
||||
|
||||
// Invalidate the window such that a FrameEvent will be generated
|
||||
|
||||
Reference in New Issue
Block a user