RecordingDevice class
final
Methods
-
beginComputePass({String? label})
→ ComputeEncoder
-
Opens a compute pass;
label names it to a debugger and to
onGpuTimings.
override
-
beginFrame()
→ void
-
Tells the backend a new frame is starting.
override
-
beginRenderPass(RenderPassDescriptor descriptor)
→ CommandEncoder
-
Opens a pass and returns the encoder that records into it.
override
-
createComputePipeline(ShaderHandle shader)
→ ComputePipelineHandle
-
A pipeline from a compute stage of this device's shader library.
override
-
createCubeRenderTarget({required int size, required TextureFormat format, int mipLevels = 1})
→ TextureHandle?
-
Allocates a cube texture a pass can draw into, face by face and level by
level, with nothing in it yet.
override
-
createCubeTextureFromPixels({required int size, required TextureFormat format, required List<ByteData> faces, List<List<ByteData>>? mipLevels})
→ TextureHandle?
-
Uploads six square images as one cube texture.
override
-
createPipeline(ShaderHandle vertex, ShaderHandle fragment, {VertexLayoutSpec? layout})
→ PipelineHandle
-
Links two stages into something that can be bound.
override
-
createStorageBuffer(ByteData bytes, {bool hostReadable = false})
→ StorageBuffer
-
A storage buffer holding
bytes. hostReadable allows readBuffer.
override
-
createTexture(RenderTargetSpec spec)
→ TextureHandle
-
A brand-new texture matching
spec, with the single TextureHandle that
will ever stand for it.
override
-
createTextureFromPixels({required int width, required int height, required TextureFormat format, required ByteData pixels, List<ByteData>? mipLevels})
→ TextureHandle?
-
Creates a texture already holding
pixels.
override
-
dispose()
→ void
-
Releases every persistent resource this device holds — the textures and
geometry buffers handed out by createTexture, createTextureFromPixels,
createCubeTextureFromPixels, createCubeRenderTarget and
uploadGeometry.
override
-
loadShaders(ByteData bytes)
→ Future<LoadedShaderLibrary>
-
Builds a library from a bundle that arrived as bytes.
override
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
onFrameComplete(void whenDone())
→ void
-
Runs
whenDone once the GPU has finished with the frame being encoded now.
override
-
onGpuTimings(void listener(GpuFrameTimings timings)?)
→ void
-
Sets where each frame's GPU timings go, a frame or two after it was
encoded; null stops them. Never called on a device whose
supportsGpuTimestamps is false.
override
-
overwriteGeometry(GeometryBuffer target, int offsetInBytes, ByteData bytes)
→ void
-
Writes
bytes into target starting offsetInBytes into it, in place.
override
-
overwriteTexture(TextureHandle target, ByteData rgba, {ScreenRect? region, int mipLevel = 0})
→ Future<void>
-
Overwrites
region (the whole texture by default) of target's base
level with rgba — raw RGBA8 bytes, region.width * region.height * 4
of them, row-major from the top the same way readback answers them.
override
-
readback(TextureHandle texture, {ScreenRect? region})
→ Future<ByteData>
-
The pixels of
region — the whole texture by default — as they stand
at this point in the queue, without waiting for the GPU to get there.
override
-
readBuffer(StorageBuffer buffer)
→ Future<ByteData>
-
The contents of
buffer, once every pass submitted before this call has
finished writing it. buffer must be hostReadable.
override
-
readPixels(TextureHandle texture)
→ Future<ByteData?>
-
The texture's pixels: premultiplied RGBA8, row-major from the
top-left.
override
-
releaseGeometry(GeometryBuffer geometry)
→ void
-
Releases one geometry buffer, rather than waiting for the whole device to
go.
override
-
releaseStorageBuffer(StorageBuffer buffer)
→ void
-
Releases one storage buffer, as releaseGeometry releases geometry.
override
-
releaseTexture(TextureHandle texture)
→ void
-
Gives one back, rather than waiting for the whole device to go.
override
-
supportsTextureFormat(TextureFormat format)
→ bool
-
Whether a texture uploaded in
format can be created and sampled here.
override
-
toString()
→ String
-
A string representation of this object.
inherited
-
uploadGeometry(ByteData bytes, GeometryUsage usage)
→ GeometryBuffer
-
Uploads geometry that will outlive the frame.
override