gpu library

Flutter GPU is a low level API for building rendering packages from scratch.

To use, first add an SDK dependency in your pubspec.yaml file:

dependencies:
  flutter_gpu:
    sdk: flutter

And then add an import statement in your Dart files:

import `package:flutter_gpu/gpu.dart`;

See also:

Classes

BufferView
A reference to a byte range within a GPU-resident Buffer.
ColorAttachment
ColorBlendEquation
CommandBuffer
DepthRange
DepthStencilAttachment
DeviceBuffer
DeviceBuffer is a region of memory allocated on the device heap (GPU-resident memory).
GpuContext
A handle to a graphics context. Used to create and manage GPU resources.
GpuImageSurface
A pool of presentable Flutter GPU render targets drawn by Flutter as a ui.Image.
GpuImageSurfaceFrame
A writable frame acquired from a GpuImageSurface.
GpuSurface
A presentable Flutter GPU render target.
GpuSurfaceFrame
A writable frame acquired from a GpuSurface.
HostBuffer
HostBuffer is a bump allocator that managed a DeviceBuffer block list.
RenderPass
RenderPipeline
RenderTarget
SamplerOptions
Scissor
Shader
ShaderLibrary
StencilConfig
Texture
TextureDestinationRegion
The upper-left destination of a texture-to-texture copy.
TextureRegion
A rectangular region within a Texture.
UniformSlot
VertexAttribute
Describes a single vertex attribute: which shader input it feeds (by name), its byte offset within the owning vertex buffer's element, and its format.
VertexBuffer
Describes one vertex buffer slot: its per-element stride, step mode, and the attributes that are read from it.
VertexLayout
A complete vertex input layout: zero or more vertex buffer slots and the attributes that read from each one.
Viewport

Enums

BlendFactor
A coefficient that scales one input to the blend equation.
BlendOperation
The operator that combines the scaled source and destination values in the blend equation.
CompareFunction
The comparison applied between a new value and the value already stored in the depth or stencil buffer.
CullMode
Which triangle faces, if any, are discarded before rasterization.
GpuPresentStatus
The result of presenting a GpuSurfaceFrame.
IndexType
The width of each element in an index buffer.
LoadAction
What happens to the contents of an attachment's Texture when a render pass begins.
MinMagFilter
How a Texture is sampled when it is minified or magnified to fit the area being drawn.
MipFilter
How samples are selected and filtered between the mipmap levels of a Texture.
PixelFormat
The memory layout of the texels in a Texture.
PolygonMode
How triangles are rasterized: as filled areas or as outlines.
PrimitiveType
How a sequence of vertices is assembled into primitives to be rasterized.
SamplerAddressMode
How texture coordinates outside the range [0, 1] are mapped back onto a Texture when sampling.
ShaderStage
A programmable stage of the render pipeline that a Shader runs in.
StencilFace
StencilOperation
The operation performed on the value in the stencil buffer based on the outcome of the stencil and depth tests.
StorageMode
Specifies where an allocation resides and how it may be used.
StoreAction
What happens to the contents of an attachment's Texture when a render pass ends.
TextureCompressionFamily
The family of a block-compressed pixel format. Hardware support for compressed formats is granted on a per-family basis.
TextureType
The kind of a Texture, which determines its dimensionality and how it is sampled.
VertexFormat
The format of a single vertex attribute.
VertexStepMode
Controls how a VertexBuffer advances through its elements while drawing.
WindingOrder
The vertex winding direction that defines the front face of a triangle.

Extensions

PixelFormatProperties on PixelFormat
Block-geometry and family queries for PixelFormat.

Properties

gpuContext GpuContext
The default graphics context.
final

Typedefs

CompletionCallback<T> = void Function(bool success)