FakePass class final

A pass that was opened, and everything that went into it.

Given stageBindings, it holds binds to the contract the way a real backend does: a block or sampler bound to a stage that does not declare it answers false, bindings do not survive bindPipeline, and a draw that leaves a declared slot unbound is written to violations. A stage the map does not name is taken on trust. Without the map it records and accepts everything, which is what every test written before 0.8.0 expects.

It is also the fake's render bundle encoder — FakePass.bundle — so that a bundle records exactly what a pass records; the members a bundle may not record throw a StateError there, as the contract says.

Inheritance
Mixed-in types
Available extensions

Constructors

FakePass(RenderPassDescriptor descriptor, {Map<String, StageBindings>? stageBindings, List<String>? violations, DeviceFeatures? features, bool links(PipelineHandle pipeline)?})
Creates a pass opened with descriptor.
FakePass.bundle(RenderBundleDescriptor bundleDescriptor, {DeviceFeatures? features})
A bundle encoder: records like a pass, and finishes into a RenderBundle whose backend object is this pass.

Properties

alphaToCoverage ↔ bool?
The last setAlphaToCoverage, or null when the pass never set it.
getter/setter pair
bundleDescriptor → RenderBundleDescriptor?
What the bundle is recorded against; null for a pass.
final
color → ColorTarget
The pass's only colour attachment. Throws a StateError for a pass with none or several.
no setter
commands → List<Recorded>
Everything recorded, in order.
final
cullMode ↔ CullMode?
The last cull mode set; null when the pass never set it.
getter/setter pair
depthCompare ↔ CompareFunction?
The last depth test set; null when the pass never set it.
getter/setter pair
depthWrite ↔ bool?
The last depth write set; null when the pass never set it.
getter/setter pair
descriptor → RenderPassDescriptor
What the pass was opened with; a descriptor with no attachments for a bundle, which has none of its own.
final
drawCount → int
How many draws were recorded, a count.
no setter
features → DeviceFeatures
What the device that opened it reports. A 1.0-surface call the set lacks is refused with UnsupportedCapabilityException, as on a real backend; one it has is recorded as a RecordedCall.
final
hashCode → int
The hash code for this object.
no setterinherited
polygonMode ↔ PolygonMode?
The last polygon mode set; null when the pass never set it.
getter/setter pair
primitiveType ↔ PrimitiveType?
The last primitive type set; null when the pass never set it.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stageBindings → Map<String, StageBindings>?
Stage name to what it declares, or null to accept every bind.
final
stencilBack ↔ StencilState?
The back-face stencil state the pass was left in; null when no call named one apart from the front.
getter/setter pair
stencilFront ↔ StencilState?
The stencil state the pass was left in, per face. Null means it was never mentioned, which is the answer every pass but the x-ray's gives.
getter/setter pair
stencilReference ↔ int?
The last stencil reference set, as given; null when the pass never set it.
getter/setter pair
submitted ↔ bool
Whether submit has been called.
getter/setter pair
violations → List<String>
Declared slots a draw left unbound, one line each, with the pipeline and the stage. Shared with the device that opened the pass.
final
windingOrder ↔ WindingOrder?
The last winding order set; null when the pass never set it.
getter/setter pair

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.
override
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.
override
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
Binds indices the device already holds. IndexType.int32 needs DeviceFeature.indexUint32 since 1.0.0-rc.1; a backend calls IndexTypeFeatures.checkFeatures here and in bindIndexData.
override
bindIndexData(ByteData bytes, IndexType type, int indexCount) → void
Binds indices built this frame. See bindVertexData and bindIndexBuffer.
override
bindPipeline(PipelineHandle pipeline) → void
Binds the pair of stages the following draws run.
override
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.
override
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.
override
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.
override
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.
override
bindUniformBuffer(ShaderHandle shader, String blockName, StorageBuffer buffer, {int offsetInBytes = 0, int? sizeInBytes}) → bool
Binds sizeInBytes bytes of buffer from offsetInBytes as the uniform block blockName of shader — DeviceFeature.uniformBuffers, since 1.0.0-rc.1. A null sizeInBytes means 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 blockName of shader from laid-out bytes — DeviceFeature.uniformBytes. See ComputeEncoder.bindUniformBytes.
override
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.
override
bindVertexData(ByteData bytes, int vertexCount, {int slot = 0}) → void
Binds vertices built this frame.
override
clearBindings() → void
Forgets every binding, leaving rasteriser state alone: uniform blocks, textures, every vertex slot and the index buffer with its count.
override
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.
override
drawIndexed(IndexedDraw draw) → void
A draw with a zero base vertex and first instance is draw, recorded as one, on every fake; anything else needs the feature.
override
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.
override
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.
override
endOcclusionQuery() → void
Stops the query beginOcclusionQuery opened.
override
endPipelineStatisticsQuery() → void
Stops the query beginPipelineStatisticsQuery opened.
override
executeBundles(List<RenderBundle> bundles) → void
Replays bundles into this pass — DeviceFeature.renderBundles.
override
finish({String? label}) → RenderBundle
Ends recording. The encoder may not be used afterwards.
override
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.
override
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.
override
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
recordedOf<T extends Recorded>() → Iterable<T>
Returns the records of type T, in order.
setAlphaToCoverage({required bool enabled}) → void
Whether the next draws turn alpha into multisample coverage — P7.
override
setBlend(BlendState? state, {int attachment = 0}) → void
Blending for one colour attachment; null switches it off.
override
setBlendColor(LinearColor color) → void
The constant the four constant-reading BlendFactors multiply by.
override
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.
override
setCullMode(CullMode mode) → void
Sets which faces the following draws discard, by the facing setWindingOrder decides.
override
setDepthBias(DepthBias bias) → void
Offsets the depth the next draws write — DeviceFeature.depthBias. DepthBias.none at the start of every pass.
override
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.
override
setDepthCompare(CompareFunction compare) → void
Sets how a fragment's depth is compared with the stored one; CompareFunction.always passes every fragment.
override
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.
override
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.
override
setPrimitiveType(PrimitiveType type) → void
How the following draws assemble their vertices.
override
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.
override
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.
override
setStencilReference(int value) → void
The value the stencil test compares against and StencilOperation.setToReferenceValue stores. Eight bits; zero until set.
override
setViewport(PassViewport viewport) → void
Where the rasteriser maps clip space, and onto which depths.
override
setWindingOrder(WindingOrder order) → void
Sets which winding in clip space counts as front-facing for the following draws. A pass starts with WindingOrder.counterClockwise.
override
submit() → void
Ends the pass and hands it to the queue.
override
toString() → String
A string representation of this object.
inherited

Operators

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