RenderBundleEncoder mixin base
Records draws once, to be replayed into many passes —
GraphicsDevice.createRenderBundleEncoder.
A PassEncoder whose recording is kept rather than submitted: everything a pass can record except the members that belong to a pass rather than to its draws. setViewport, setScissor, setBlendColor, setStencilReference, the queries and executeBundles throw a StateError here — WebGPU's bundle has none of them, and a backend that replays by re-recording would otherwise apply them to the wrong pass.
A bind… call inside a bundle answers from the stage's declarations at
recording time — false for a slot the stage does not declare, exactly as
in a pass — because nothing is bound until the bundle is replayed. A
backend may implement a bundle natively (WebGPU) or by recording the calls
and replaying them into the pass (WebGL2, the software rasteriser).
multiDrawIndirect with a count buffer may be refused here with a StateError as well: WebGPU's bundles have no indirect count.
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.
- Superclass constraints
- Mixin applications
- Available extensions
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
-
beginOcclusionQuery(
int queryIndex) → void -
Starts counting the samples the next draws pass into query
queryIndexofRenderPassDescriptor.occlusionQuerySet—DeviceFeature.occlusionQuery. One query open at a time.inherited -
beginPipelineStatisticsQuery(
QuerySet querySet, int queryIndex) → void -
Starts counting into query
queryIndexofquerySet, a QueryType.pipelineStatistics set —DeviceFeature.pipelineStatisticsQuery. The five counters are those PipelineStatistic lists, in its order.inherited -
bindBlock(
ShaderHandle stage, UniformBlock block) → bool -
Available on PassEncoder, provided by the BindUniformBlockObject extension
Bindsblocktostage—bindUniformBlockwith the block's name and members. -
bindIndexBuffer(
GeometryBuffer buffer, IndexType type, int indexCount) → void -
Binds indices the device already holds. IndexType.int32 needs
DeviceFeature.indexUint32since 1.0.0-rc.1; a backend callsIndexTypeFeatures.checkFeatureshere and in bindIndexData.inherited -
bindIndexData(
ByteData bytes, IndexType type, int indexCount) → void -
Binds indices built this frame. See bindVertexData and
bindIndexBuffer.
inherited
-
bindPipeline(
PipelineHandle pipeline) → void -
Binds the pair of stages the following draws run.
inherited
-
bindStorageBuffer(
ShaderHandle shader, String name, StorageBuffer buffer, {int offsetInBytes = 0, int? sizeInBytes}) → bool -
Binds
buffer(a range of it, asComputeEncoder.bindStorageBufferdoes) to the storage bindingnameof a render stage —DeviceFeature.renderStageStorage. False when the stage declares no such binding.inherited -
bindStorageTexture(
ShaderHandle shader, String name, TextureHandle texture, {int mipLevel = 0, StorageTextureAccess access = StorageTextureAccess.writeOnly}) → bool -
Binds level
mipLeveloftextureas the storage texturenameof a render stage —DeviceFeature.renderStageStorage, withComputeEncoder.bindStorageTexture's format and access rules.inherited -
bindTexture(
ShaderHandle shader, String slot, TextureHandle texture, {SamplerDescriptor? sampler}) → bool -
Binds
textureto the sampler calledslotinshader. False when that stage declares no such sampler.inherited -
bindUniformBlock(
ShaderHandle shader, String blockName, Map< String, Float32List> members) → bool -
Fills the uniform block
blockNameofshaderfrommembersand binds it. False when the shader has no such block.inherited -
bindUniformBuffer(
ShaderHandle shader, String blockName, StorageBuffer buffer, {int offsetInBytes = 0, int? sizeInBytes}) → bool -
Binds
sizeInBytesbytes ofbufferfromoffsetInBytesas the uniform blockblockNameofshader—DeviceFeature.uniformBuffers, since 1.0.0-rc.1. A nullsizeInBytesmeans the rest of the buffer, as bindStorageBuffer's does. False when the stage declares no such block, as bindUniformBlock answers.inherited -
bindUniformBytes(
ShaderHandle shader, String blockName, ByteData bytes) → bool -
Fills the uniform block
blockNameofshaderfrom laid-outbytes—DeviceFeature.uniformBytes. SeeComputeEncoder.bindUniformBytes.inherited -
bindVertexBuffer(
GeometryBuffer buffer, int vertexCount, {int slot = 0}) → void -
Binds geometry the device already holds — a mesh, or the one triangle
every full-screen pass draws.
inherited
-
bindVertexData(
ByteData bytes, int vertexCount, {int slot = 0}) → void -
Binds vertices built this frame.
inherited
-
clearBindings(
) → void -
Forgets every binding, leaving rasteriser state alone: uniform blocks,
textures, every vertex slot and the index buffer with its count.
inherited
-
draw(
{int instanceCount = 1, int firstIndex = 0, int? indexCount}) → void -
Draws what is bound: indexed when an index buffer is bound, and the
vertices in order otherwise. drawNonIndexed is the 1.0 call for the
second, with a first vertex and a first instance.
inherited
-
drawIndexed(
IndexedDraw draw) → void -
An indexed draw with every argument a native draw takes —
P7's window, plus a base vertex added to each index and a first instance.inherited -
drawIndirect(
StorageBuffer arguments, {int offsetInBytes = 0}) → void -
An indexed draw whose counts
argumentsholds atoffsetInBytes— seedrawIndexedIndirectArgumentsfor the twenty bytes — against the bound index buffer. The buffer must have been made with BufferUsage.indirect.DeviceFeature.indirectDraw; a non-zero first instance needsDeviceFeature.indirectFirstInstanceas well.inherited -
drawNonIndexed(
{required int vertexCount, int firstVertex = 0, int instanceCount = 1, int firstInstance = 0}) → void -
Draws
vertexCountvertices fromfirstVertexin order, with no index buffer,instanceCounttimes fromfirstInstance—DeviceFeature.nonIndexedDraw. The bound index buffer, if any, is ignored rather than forgotten.inherited -
endOcclusionQuery(
) → void -
Stops the query beginOcclusionQuery opened.
inherited
-
endPipelineStatisticsQuery(
) → void -
Stops the query beginPipelineStatisticsQuery opened.
inherited
-
executeBundles(
List< RenderBundle> bundles) → void -
Replays
bundlesinto this pass —DeviceFeature.renderBundles.inherited -
finish(
{String? label}) → RenderBundle - Ends recording. The encoder may not be used afterwards.
-
insertDebugMarker(
String label) → void -
Marks one point in the command stream with
label.inherited -
multiDraw(
List< IndexedDraw> draws) → void -
Several indexed draws of the same bindings in one call —
DeviceFeature.multiDraw. Each entry follows drawIndexed's rules.inherited -
multiDrawIndirect(
StorageBuffer arguments, int drawCount, {int offsetInBytes = 0, StorageBuffer? countBuffer, int countOffsetInBytes = 0}) → void -
drawCountindirect indexed draws read fromarguments, twenty bytes each fromoffsetInBytes—DeviceFeature.multiDrawIndirect. WhencountBufferis given, the number actually drawn is the 32-bit value it holds atcountOffsetInBytes, at mostdrawCount: a culling compute pass decides how many survive and nothing reads the number back.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
popDebugGroup(
) → void -
Closes the group the last pushDebugGroup opened.
inherited
-
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.
inherited
-
setAlphaToCoverage(
{required bool enabled}) → void -
Whether the next draws turn alpha into multisample coverage —
P7.inherited -
setBlend(
BlendState? state, {int attachment = 0}) → void -
Blending for one colour attachment; null switches it off.
inherited
-
setBlendColor(
LinearColor color) → void -
The constant the four constant-reading BlendFactors multiply by.
inherited
-
setColorWriteMask(
ColorWriteMask mask, {int attachment = 0}) → void -
Which channels of colour attachment
attachmentthe next draws may change —DeviceFeature.colorWriteMask. ColorWriteMask.all at the start of every pass. The index follows setBlend's rule: honoured only whereDeviceFeature.independentBlendis.inherited -
setCullMode(
CullMode mode) → void -
Sets which faces the following draws discard, by the facing
setWindingOrder decides.
inherited
-
setDepthBias(
DepthBias bias) → void -
Offsets the depth the next draws write —
DeviceFeature.depthBias. DepthBias.none at the start of every pass.inherited -
setDepthClamp(
{required bool enabled}) → void -
Whether the next draws clamp depth to the range instead of clipping
against the near and far planes —
DeviceFeature.depthClamp. Off at the start of every pass. What a shadow caster behind the light's near plane wants.inherited -
setDepthCompare(
CompareFunction compare) → void -
Sets how a fragment's depth is compared with the stored one;
CompareFunction.always passes every fragment.
inherited
-
setDepthWrite(
{required bool enabled}) → void -
Sets whether fragments that pass the depth test write their depth.
Meaningful only against a depth attachment that is not read-only.
inherited
-
setPolygonMode(
PolygonMode mode) → void -
Filled or drawn as edges. Ask
features.has(DeviceFeature.wireframe)before naming PolygonMode.line: a backend that cannot draw it throwsUnsupportedCapabilityExceptionrather than filling.inherited -
setPrimitiveType(
PrimitiveType type) → void -
How the following draws assemble their vertices.
inherited
-
setScissor(
ScreenRect rect) → void -
Where fragments survive. Bounds a draw, and — unlike a clear — is honoured
by one. Whole pixels on every API, so a ScreenRect.
inherited
-
setState(
PassState state) → void -
Available on PassEncoder, provided by the PassStateApply extension
Emits one call per fieldstatesets, and nothing for the rest. -
setStencil(
StencilState front, {StencilState? back}) → void -
The stencil test for the draws that follow.
inherited
-
setStencilReference(
int value) → void -
The value the stencil test compares against and
StencilOperation.setToReferenceValue stores. Eight bits; zero until
set.
inherited
-
setViewport(
PassViewport viewport) → void -
Where the rasteriser maps clip space, and onto which depths.
inherited
-
setWindingOrder(
WindingOrder order) → void -
Sets which winding in clip space counts as front-facing for the following
draws. A pass starts with WindingOrder.counterClockwise.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited