gpu: make GPU an interface to prepare for second implementation

While here, merge BeginFrame and EndFrame; the split was done for
performance reasons, yet never measured.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-12-30 18:02:18 +01:00
parent b1ff179aa0
commit 6f2a98c667
3 changed files with 33 additions and 18 deletions
+4 -3
View File
@@ -88,10 +88,11 @@ func (l *renderLoop) renderLoop(ctx window.Context) error {
g.Collect(frame.viewport, frame.ops)
// Signal that we're done with the frame ops.
l.ack <- struct{}{}
g.BeginFrame()
var res frameResult
res.err = ctx.Present()
g.EndFrame()
res.err = g.Frame()
if res.err == nil {
res.err = ctx.Present()
}
res.profile = g.Profile()
ctx.Unlock()
l.results <- res