Documentation
¶
Overview ¶
Package gpu implements the rendering of Gio drawing operations. It is used by package app and package gpu/headless and is otherwise not useful except for integrating with external window implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrDeviceLost = driver.ErrDeviceLost
ErrDeviceLost is returned from GPU operations when the underlying GPU device is lost and should be recreated.
Functions ¶
Types ¶
type API ¶
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 Direct3D11RenderTarget ¶
type Direct3D11RenderTarget = driver.Direct3D11RenderTarget
Direct3D11RenderTarget is a render target suitable for the Direct3D 11 backend.
type GPU ¶
type GPU interface {
// Release non-Go resources. The GPU is no longer valid after Release.
Release()
// Clear sets the clear color for the next Frame.
Clear(color color.NRGBA)
// Frame draws the graphics operations from op into a viewport of target.
Frame(frame *op.Ops, target RenderTarget, viewport image.Point) error
}
type MetalRenderTarget ¶
type MetalRenderTarget = driver.MetalRenderTarget
MetalRenderTarget is a render target suitable for the Metal backend.
type OpenGLRenderTarget ¶
type OpenGLRenderTarget = driver.OpenGLRenderTarget
OpenGLRenderTarget is a render target suitable for the OpenGL backend.
type RenderTarget ¶
type RenderTarget = driver.RenderTarget
A RenderTarget denotes the destination framebuffer for a frame.
type Stats ¶
type Stats struct {
// PathBuilds counts the filled shapes (clip.Outline, clip.Path, and
// shapes made of them, like rounded rectangles and text drawn as
// paths) flattened and uploaded as a new vertex buffer. A shape is
// cached by the operation that drew it, so a shape drawn straight
// into a frame's ops is built again every frame it is drawn, while
// one replayed from a recording kept across frames is built once.
PathBuilds uint64
// PathVertexBytes counts bytes submitted for those path uploads.
PathVertexBytes uint64
// ShaderPipelines counts the paint.Shader pipeline sets built
// successfully: one per Shader on its first paint, never again while
// the GPU lives.
ShaderPipelines uint64
// ShaderFallbacks counts shader paints drawn as their Fallback colour
// because the backend could not draw them; ShaderErr says why.
ShaderFallbacks uint64
// LayerRepaints counts affine layers rendered into an offscreen target.
LayerRepaints uint64
// LayerComposites counts affine layer quads drawn from that target.
LayerComposites uint64
// LayerFallbacks counts layers that could not be captured and either
// drew directly or were omitted when capture-only.
LayerFallbacks uint64
// LayerTargetAllocations counts new and resized layer atlas textures,
// including textures used by opacity layers.
LayerTargetAllocations uint64
// LayerCaptures counts shader layer sources rendered into an offscreen target.
LayerCaptures uint64
// LayerEffects counts composites drawn with a custom layer shader.
LayerEffects uint64
// LayerEffectFallbacks counts attempted layer draws that used the plain
// composite, drew directly, or were skipped for a missing source or path clip.
LayerEffectFallbacks uint64
}
Stats are a GPU's running totals, for finding drawing that defeats the renderer's caches (giokit).
type VulkanRenderTarget ¶
type VulkanRenderTarget = driver.VulkanRenderTarget
VulkanRenderTarget is a render target suitable for the Vulkan backend.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package headless implements headless windows for rendering an operation list to an image.
|
Package headless implements headless windows for rendering an operation list to an image. |
|
internal
|
|
|
rendertest
Package rendertest is intended for testing of drawing ops only.
|
Package rendertest is intended for testing of drawing ops only. |
|
rendertest/testshaders
Package testshaders holds the paint shaders of rendertest's paint.ShaderOp tests (giokit patch).
|
Package testshaders holds the paint shaders of rendertest's paint.ShaderOp tests (giokit patch). |