mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 17:35:36 +00:00
gpu,gpu/headless,app/internal/wm: add explicit RenderTarget API
Both the OpenGL and the Direct3D API are stateful and gpu.GPU renders to the render target current when Frame is called. Modern GPU API such as Metal don't have a concept of a current render target, and the target even changes each frame. Add RenderTarget and add an explicit target argument to GPU.Frame as well as the underlying driver.Device.BeginFrame. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+1
-1
@@ -100,7 +100,7 @@ func (l *renderLoop) renderLoop(ctx wm.Context) error {
|
||||
g.Collect(frame.viewport, frame.ops)
|
||||
// Signal that we're done with the frame ops.
|
||||
l.ack <- struct{}{}
|
||||
res.err = g.Frame()
|
||||
res.err = g.Frame(ctx.RenderTarget())
|
||||
if res.err == nil {
|
||||
res.err = ctx.Present()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user