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
+2 -4
View File
@@ -18,7 +18,7 @@ type Window struct {
size image.Point
ctx context
backend backend.Device
gpu *gpu.GPU
gpu gpu.GPU
fboTex backend.Texture
fbo backend.Framebuffer
}
@@ -109,9 +109,7 @@ func (w *Window) Release() {
func (w *Window) Frame(frame *op.Ops) error {
return contextDo(w.ctx, func() error {
w.gpu.Collect(w.size, frame)
w.gpu.BeginFrame()
w.gpu.EndFrame()
return nil
return w.gpu.Frame()
})
}