mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +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:
@@ -8,6 +8,15 @@ import "gioui.org/gpu/internal/driver"
|
||||
// There is an API type for each supported GPU API such as OpenGL and Direct3D.
|
||||
type API = driver.API
|
||||
|
||||
// A RenderTarget denotest the destination framebuffer for a frame.
|
||||
type RenderTarget = driver.RenderTarget
|
||||
|
||||
// OpenGLRenderTarget is a render target suitable for the OpenGL backend.
|
||||
type OpenGLRenderTarget = driver.OpenGLRenderTarget
|
||||
|
||||
// Direct3D11RenderTarget is a render target suitable for the Direct3D 11 backend.
|
||||
type Direct3D11RenderTarget = driver.Direct3D11RenderTarget
|
||||
|
||||
// OpenGL denotes the OpenGL or OpenGL ES API.
|
||||
type OpenGL = driver.OpenGL
|
||||
|
||||
|
||||
Reference in New Issue
Block a user