mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 15:45:38 +00:00
7d84e419c9
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>
25 lines
813 B
Go
25 lines
813 B
Go
// SPDX-License-Identifier: Unlicense OR MIT
|
|
|
|
package gpu
|
|
|
|
import "gioui.org/gpu/internal/driver"
|
|
|
|
// An API carries the necessary GPU API specific resources to create a Device.
|
|
// 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
|
|
|
|
// Direct3D11 denotes the Direct3D API.
|
|
type Direct3D11 = driver.Direct3D11
|