A GPU the renderer draws with.
This is the only layer that knows a GPU API. Today the backend is
Flutter GPU (flutter_gpu); a WebGL2 backend can implement the same
interface later. A null backend records commands for unit tests.
Objects it hands out are released when they become unreachable; there is nothing to destroy explicitly.
- Implementers
Properties
Methods
-
beginFrame(
) → void - Starts a frame — each view drawn is one. Call before recording it.
-
commands(
) → GpuCommands - A list of commands to record and submit.
-
createBuffer(
ByteData data) → GpuBuffer -
A buffer holding
data, for vertices or indices that do not change. -
createHostBuffer(
int sizeInBytes) → GpuBuffer -
A buffer of
sizeInBytesthe CPU can rewrite (GpuBuffer.write). -
createSurface(
int width, int height) → GpuSurface - A presentable target Flutter draws as a ui.Image.
-
createTexture(
GpuTextureDesc desc) → GpuTexture - A texture.
-
frameData(
ByteData data) → GpuBufferView -
Copies
datainto this frame's transient memory, aligned for use as uniforms, vertices or indices. A commands list made or submitted during the frame keeps it from being written again until the GPU has finished that list. -
loadShaderLibrary(
String fileName) → Future< GpuShaderLibrary> -
Loads the package shader bundle
fileName(for examplecore.shaderbundle) once. -
maxMipLevels(
int width, int height) → int -
The most mip levels a
width×heighttexture may have here. Flutter GPU allowsfloor(log2(min(width, height))), one fewer than a full chain (flutter/flutter#186176). -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pipeline(
GpuShader vertex, GpuShader fragment, {GpuVertexLayout? layout}) → GpuPipeline -
The pipeline for
vertexandfragmentreadinglayout(null: the vertex shader's inputs, interleaved in declaration order). Cached: the same arguments return the same pipeline. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited