ComputeEncoder class abstract base

Records one compute pass: bindings, then dispatches, then submit.

The same shape as a render pass's encoder, and the same rules: a binding the stage does not declare answers false rather than throwing, and bindPipeline forgets every binding made before it.

Implementable outside this package, and stays so through 1.x. It does not grow within a major: a capability added later arrives beside it — a second interface an implementation opts into, or a member with a default on a base class — so an implementation written against 1.0 keeps compiling.

Implementers

Constructors

ComputeEncoder()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

beginPipelineStatisticsQuery(QuerySet querySet, int queryIndex) → void
Starts counting into query queryIndex of querySet, a QueryType.pipelineStatistics set — DeviceFeature.pipelineStatisticsQuery. Only PipelineStatistic.computeShaderInvocations counts in a compute pass.
bindPipeline(ComputePipelineHandle pipeline) → void
Makes pipeline the one the next dispatch runs, and forgets every binding.
bindStorageBuffer(ShaderHandle shader, String name, StorageBuffer buffer, {int offsetInBytes = 0, int? sizeInBytes}) → bool
Binds buffer to the storage binding name of shader. False when the stage declares no such binding.
bindStorageTexture(ShaderHandle shader, String name, TextureHandle texture, {int mipLevel = 0, StorageTextureAccess access = StorageTextureAccess.writeOnly}) → bool
Binds level mipLevel of texture as the storage texture name of shader. False when the stage declares no such binding.
bindTexture(ShaderHandle shader, String slot, TextureHandle texture, {SamplerDescriptor? sampler}) → bool
Binds texture to the sampled-texture binding slot of shader, with sampler (null meaning SamplerDescriptor.linearRepeat, as for a render pass). False when the stage declares no such binding.
bindUniformBlock(ShaderHandle shader, String blockName, Map<String, Float32List> members) → bool
Binds the uniform block blockName of shader, by member name, exactly as PassEncoder.bindUniformBlock does. False when the stage declares no such block.
bindUniformBytes(ShaderHandle shader, String blockName, ByteData bytes) → bool
Fills the uniform block blockName of shader from bytes, laid out the way the compiled stage lays the block out (std140 for the engine's bundles). For integer and packed members a float map cannot carry. False when the stage declares no such block. DeviceFeature.uniformBytes.
dispatch(int x, [int y = 1, int z = 1]) → void
Runs the bound pipeline over a grid of x × y × z workgroups.
dispatchIndirect(StorageBuffer arguments, {int offsetInBytes = 0}) → void
Runs the bound pipeline over the grid arguments holds at offsetInBytes — see dispatchIndirectArguments for the twelve bytes. The buffer must have been made with BufferUsage.indirect. DeviceFeature.indirectDispatch.
endPipelineStatisticsQuery() → void
Stops the query beginPipelineStatisticsQuery opened.
insertDebugMarker(String label) → void
Marks one point in the command stream with label.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
popDebugGroup() → void
Closes the group the last pushDebugGroup opened.
pushDebugGroup(String label) → void
Opens a named group around the commands recorded until the matching popDebugGroup, for a GPU debugger or a frame capture to show as one node. Groups nest. Does nothing on a backend without markers.
submit() → void
Hands the pass to the queue. Nothing recorded after this reaches it.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited