DepthTarget class final

The depth and stencil attachment of a pass.

Almost every pass here clears depth on entry and discards it on exit, and those are the defaults. The one pass that asked for more is weighted blended transparency (R8): its transparent draws go into targets of their own, in passes after the opaque ones, and have to be tested against the depth those left — so the opaque pass stores its depth and the transparent passes load it. loadAction and storeAction are that request, and nothing else sets them.

The stencil half is configurable, because the x-ray stage asked: it marks the stencil inside the scene pass and reads the marks back a few draws later, which needs the buffer cleared to a known value on entry. The three fields are flutter_gpu's own, and their defaults — clear to zero, throw away at the end — are what every pass that never mentions the stencil has always had.

Constructors

DepthTarget({required TextureHandle texture, double clearValue = 1.0, LoadAction loadAction = LoadAction.clear, StoreAction storeAction = StoreAction.dontCare, LoadAction stencilLoadAction = LoadAction.clear, StoreAction stencilStoreAction = StoreAction.dontCare, int stencilClearValue = 0, int mipLevel = 0, int layer = 0, int face = 0, bool depthReadOnly = false, bool stencilReadOnly = false})
Creates a depth attachment drawing into texture, cleared to depth one by default.
const

Properties

clearValue → double
The far plane. One under this engine's [0, 1] depth convention; a reversed-Z backend would want zero, which is why it is a parameter. A depth from 0 to 1, unitless.
final
depthReadOnly → bool
The pass tests against the depth but never writes it, so the same texture may be sampled by the pass at the same time. WebGPU's depthReadOnly; the load and store actions are then ignored.
final
face → int
Which face of a cube or cube-array texture is the attachment, in ColorTarget.face's order. Zero for every other shape.
final
hashCode → int
The hash code for this object.
no setterinherited
layer → int
Which layer of an array texture is the attachment — a cascaded or point-light shadow drawn layer by layer. Ask DeviceFeature.renderToArrayLayer before naming anything but zero.
final
loadAction → LoadAction
What the depth holds when the pass opens: clearValue everywhere, or with LoadAction.load what the last pass that stored it left.
final
mipLevel → int
Which level of texture is the attachment — for a depth pyramid, or a shadow drawn into one level of a chain. Ask DeviceFeature.renderToMipLevel before naming anything but zero.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stencilClearValue → int
Eight bits, masked to the attachment's depth by the backend.
final
stencilLoadAction → LoadAction
What the stencil holds when the pass opens. LoadAction.clear fills it with stencilClearValue across the whole attachment, as every clear here does; LoadAction.load keeps what the last pass stored.
final
stencilReadOnly → bool
As depthReadOnly, for the stencil.
final
stencilStoreAction → StoreAction
Whether the stencil survives the pass. Nothing in this engine reads one across passes yet, so the default discards it, which is free on tile memory and merely honest elsewhere.
final
storeAction → StoreAction
Whether the depth survives the pass. StoreAction.dontCare lets a tiler keep it in tile memory and throw it away, which is what every pass that no later pass loads wants.
final
texture → TextureHandle
The depth, or depth and stencil, texture the pass tests and writes.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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