PassEncoder class abstract base mixin

A pass that is open, into which draws are recorded.

This is what a PassContributor is handed: it draws into a pass it does not own, so it can record but must not end. Ending belongs to whoever opened it, which is why CommandEncoder is a separate type — the overlay stage was once handed a pass whose command buffer had already been submitted, and the split is that trap made unreachable by the type.

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
Available extensions

Constructors

PassEncoder()

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 queryIndex of RenderPassDescriptor.occlusionQuerySet — DeviceFeature.occlusionQuery. One query open at a time.
beginPipelineStatisticsQuery(QuerySet querySet, int queryIndex) → void
Starts counting into query queryIndex of querySet, a QueryType.pipelineStatistics set — DeviceFeature.pipelineStatisticsQuery. The five counters are those PipelineStatistic lists, in its order.
bindBlock(ShaderHandle stage, UniformBlock block) → bool

Available on PassEncoder, provided by the BindUniformBlockObject extension

Binds block to stage — bindUniformBlock with the block's name and members.
bindIndexBuffer(GeometryBuffer buffer, IndexType type, int indexCount) → void
bindIndexData(ByteData bytes, IndexType type, int indexCount) → void
Binds indices built this frame. See bindVertexData.
bindPipeline(PipelineHandle pipeline) → void
Binds the pair of stages the following draws run.
bindStorageBuffer(ShaderHandle shader, String name, StorageBuffer buffer, {int offsetInBytes = 0, int? sizeInBytes}) → bool
Binds buffer (a range of it, as ComputeEncoder.bindStorageBuffer does) to the storage binding name of a render stage — DeviceFeature.renderStageStorage. 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 a render stage — DeviceFeature.renderStageStorage, with ComputeEncoder.bindStorageTexture's format and access rules.
bindTexture(ShaderHandle shader, String slot, TextureHandle texture, {SamplerDescriptor? sampler}) → bool
Binds texture to the sampler called slot in shader. False when that stage declares no such sampler.
bindUniformBlock(ShaderHandle shader, String blockName, Map<String, Float32List> members) → bool
Fills the uniform block blockName of shader from members and binds it. False when the shader has no such block.
bindUniformBytes(ShaderHandle shader, String blockName, ByteData bytes) → bool
Fills the uniform block blockName of shader from laid-out bytes — DeviceFeature.uniformBytes. See ComputeEncoder.bindUniformBytes.
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.
bindVertexData(ByteData bytes, int vertexCount, {int slot = 0}) → void
Binds vertices built this frame.
clearBindings() → void
Forgets every binding, leaving rasteriser state alone: uniform blocks, textures, every vertex slot and the index buffer with its count.
draw({int instanceCount = 1, int firstIndex = 0, int? indexCount}) → void
Draws what is bound. Always indexed — there is no non-indexed path in this engine, which is why the debug overlay keeps an identity index sequence.
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.
drawIndirect(StorageBuffer arguments, {int offsetInBytes = 0}) → void
An indexed draw whose counts arguments holds at offsetInBytes — see drawIndexedIndirectArguments for the twenty bytes — against the bound index buffer. The buffer must have been made with BufferUsage.indirect. DeviceFeature.indirectDraw; a non-zero first instance needs DeviceFeature.indirectFirstInstance as well.
drawNonIndexed({required int vertexCount, int firstVertex = 0, int instanceCount = 1, int firstInstance = 0}) → void
Draws vertexCount vertices from firstVertex in order, with no index buffer, instanceCount times from firstInstance — DeviceFeature.nonIndexedDraw. The bound index buffer, if any, is ignored rather than forgotten.
endOcclusionQuery() → void
Stops the query beginOcclusionQuery opened.
endPipelineStatisticsQuery() → void
Stops the query beginPipelineStatisticsQuery opened.
executeBundles(List<RenderBundle> bundles) → void
Replays bundles into this pass — DeviceFeature.renderBundles.
insertDebugMarker(String label) → void
Marks one point in the command stream with label.
multiDraw(List<IndexedDraw> draws) → void
Several indexed draws of the same bindings in one call — DeviceFeature.multiDraw. Each entry follows drawIndexed's rules.
multiDrawIndirect(StorageBuffer arguments, int drawCount, {int offsetInBytes = 0, StorageBuffer? countBuffer, int countOffsetInBytes = 0}) → void
drawCount indirect indexed draws read from arguments, twenty bytes each from offsetInBytes — DeviceFeature.multiDrawIndirect. When countBuffer is given, the number actually drawn is the 32-bit value it holds at countOffsetInBytes, at most drawCount: a culling compute pass decides how many survive and nothing reads the number back.
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.
setAlphaToCoverage({required bool enabled}) → void
Whether the next draws turn alpha into multisample coverage — P7.
setBlend(BlendState? state, {int attachment = 0}) → void
Blending for one colour attachment; null switches it off.
setBlendColor(LinearColor color) → void
The constant the four constant-reading BlendFactors multiply by.
setColorWriteMask(ColorWriteMask mask, {int attachment = 0}) → void
Which channels of colour attachment attachment the next draws may change — DeviceFeature.colorWriteMask. ColorWriteMask.all at the start of every pass. The index follows setBlend's rule: honoured only where DeviceFeature.independentBlend is.
setCullMode(CullMode mode) → void
setDepthBias(DepthBias bias) → void
Offsets the depth the next draws write — DeviceFeature.depthBias. DepthBias.none at the start of every pass.
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.
setDepthCompare(CompareFunction compare) → void
setDepthWrite({required bool enabled}) → void
setPolygonMode(PolygonMode mode) → void
Filled or drawn as edges. Ask features.has(DeviceFeature.wireframe) before naming PolygonMode.line: a backend that cannot draw it throws UnsupportedCapabilityException rather than filling.
setPrimitiveType(PrimitiveType type) → void
How the following draws assemble their vertices.
setScissor(ScreenRect rect) → void
Where fragments survive. Bounds a draw, and — unlike a clear — is honoured by one.
setState(PassState state) → void

Available on PassEncoder, provided by the PassStateApply extension

Emits one call per field state sets, and nothing for the rest.
setStencil(StencilState front, {StencilState? back}) → void
The stencil test for the draws that follow.
setStencilReference(int value) → void
The value the stencil test compares against and StencilOperation.setToReferenceValue stores. Eight bits; zero until set.
setViewport(ScreenRect rect) → void
Where the rasteriser may write.
setWindingOrder(WindingOrder order) → void
toString() → String
A string representation of this object.
inherited

Operators

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