Targets, drawBuffers and state
Behavior and constraints
targets.colors uses location/resource/view/framesAgo for color attachments; depth defines the depth attachment. Both declare loadOp/storeOp and use clearValue under the matching clear contract. location is a fragment output location, not a texture binding slot. Attachment dimensions and formats must form a supported target; color and depth formats cannot exchange roles.
load preserves contents, clear writes clearValue and dontCare leaves contents undefined. store retains values for later consumers; later readers cannot rely on dontCare. Use dontCare only when the valid area is fully overwritten. Do not sample and write the same image in a draw. An attached image does not imply an enabled output.
drawBuffers is command-local and must match fragment outputs and target locations. Per-target blendTargets has additional layout rules. blend/depth/rasterizer use generated closed tokens. inherit does not mean every Provider accepts omission: Scene Providers can require explicit state, as recorded in Catalog.sceneDrawProviders.
Viewport target/frame, restoration and scissor synchronization determine the execution region. frameTarget owns whole-frame color/depth rather than Terrain-only MRT. Chapter 04 keeps frameTarget at RT0+depth with three-color Scene topology, opaque outputs 0/1/2 and RT0-only BuiltIn fallback activity.
Generated v5 structure
Required applies to the displayed object/branch. Absence of a Schema default does not establish a runtime default. Conditional rules remain in the complete definition below; Loader validation also resolves IDs, ownership, budgets and device limits.
targets · v5
| Field / branch | Presence in this object | Structural constraints |
|---|---|---|
colors | optional here | type="array"; uniqueItems=true; items=#/$defs/colorTarget |
depth | optional here | $ref="#/$defs/depthTarget" |
Full structural rule: #/$defs/targets
{
"additionalProperties": false,
"minProperties": 1,
"properties": {
"colors": {
"items": {
"$ref": "#/$defs/colorTarget"
},
"type": "array",
"uniqueItems": true
},
"depth": {
"$ref": "#/$defs/depthTarget"
}
},
"type": "object"
}colorTarget · v5
| Field / branch | Presence in this object | Structural constraints |
|---|---|---|
clearValue | optional here | type="array"; minItems=4; maxItems=4 |
framesAgo | optional here | type="integer"; minimum=1 |
loadOp | required | enum=["load","clear","dontCare"] |
location | required | type="integer"; minimum=0 |
resource | required | $ref="#/$defs/identifier" |
storeOp | required | enum=["store","dontCare"] |
view | optional here | enum=["dawnlight:direct","dawnlight:history/current","dawnlight:history/previous","dawnlight:shadow/consumer","dawnlight:shadow/producer"] |
Full structural rule: #/$defs/colorTarget
{
"additionalProperties": false,
"allOf": [
{
"if": {
"properties": {
"loadOp": {
"const": "clear"
}
},
"required": [
"loadOp"
]
},
"then": {
"required": [
"clearValue"
]
}
},
{
"if": {
"not": {
"properties": {
"loadOp": {
"const": "clear"
}
},
"required": [
"loadOp"
]
}
},
"then": {
"not": {
"anyOf": [
{
"required": [
"clearValue"
]
}
]
}
}
}
],
"properties": {
"clearValue": {
"items": {
"type": "number"
},
"maxItems": 4,
"minItems": 4,
"type": "array"
},
"framesAgo": {
"minimum": 1,
"type": "integer"
},
"loadOp": {
"enum": [
"load",
"clear",
"dontCare"
]
},
"location": {
"minimum": 0,
"type": "integer"
},
"resource": {
"$ref": "#/$defs/identifier"
},
"storeOp": {
"enum": [
"store",
"dontCare"
]
},
"view": {
"enum": [
"dawnlight:direct",
"dawnlight:history/current",
"dawnlight:history/previous",
"dawnlight:shadow/consumer",
"dawnlight:shadow/producer"
]
}
},
"required": [
"location",
"resource",
"loadOp",
"storeOp"
],
"type": "object"
}depthTarget · v5
| Field / branch | Presence in this object | Structural constraints |
|---|---|---|
clearValue | optional here | type="number"; minimum=0; maximum=1 |
framesAgo | optional here | type="integer"; minimum=1 |
loadOp | required | enum=["load","clear","dontCare"] |
resource | required | $ref="#/$defs/identifier" |
storeOp | required | enum=["store","dontCare"] |
view | optional here | enum=["dawnlight:direct","dawnlight:history/current","dawnlight:history/previous","dawnlight:shadow/consumer","dawnlight:shadow/producer"] |
Full structural rule: #/$defs/depthTarget
{
"additionalProperties": false,
"allOf": [
{
"if": {
"properties": {
"loadOp": {
"const": "clear"
}
},
"required": [
"loadOp"
]
},
"then": {
"required": [
"clearValue"
]
}
},
{
"if": {
"not": {
"properties": {
"loadOp": {
"const": "clear"
}
},
"required": [
"loadOp"
]
}
},
"then": {
"not": {
"anyOf": [
{
"required": [
"clearValue"
]
}
]
}
}
}
],
"properties": {
"clearValue": {
"maximum": 1,
"minimum": 0,
"type": "number"
},
"framesAgo": {
"minimum": 1,
"type": "integer"
},
"loadOp": {
"enum": [
"load",
"clear",
"dontCare"
]
},
"resource": {
"$ref": "#/$defs/identifier"
},
"storeOp": {
"enum": [
"store",
"dontCare"
]
},
"view": {
"enum": [
"dawnlight:direct",
"dawnlight:history/current",
"dawnlight:history/previous",
"dawnlight:shadow/consumer",
"dawnlight:shadow/producer"
]
}
},
"required": [
"resource",
"loadOp",
"storeOp"
],
"type": "object"
}state · v5
| Field / branch | Presence in this object | Structural constraints |
|---|---|---|
blend | optional here | enum=["inherit","opaque","alphaBlend","nonPremultiplied"] |
blendTargets | optional here | type="array"; minItems=1; uniqueItems=true |
depth | optional here | enum=["inherit","default","depthWrite","depthTestWriteLess","disabled"] |
rasterizer | optional here | enum=["inherit","cullCounterClockwiseScissor","cullClockwiseScissor","cullNoneScissor"] |
Full structural rule: #/$defs/state
{
"additionalProperties": false,
"properties": {
"blend": {
"enum": [
"inherit",
"opaque",
"alphaBlend",
"nonPremultiplied"
]
},
"blendTargets": {
"items": {
"minimum": 0,
"type": "integer"
},
"minItems": 1,
"type": "array",
"uniqueItems": true
},
"depth": {
"enum": [
"inherit",
"default",
"depthWrite",
"depthTestWriteLess",
"disabled"
]
},
"rasterizer": {
"enum": [
"inherit",
"cullCounterClockwiseScissor",
"cullClockwiseScissor",
"cullNoneScissor"
]
}
},
"type": "object"
}drawBufferLayout · v5
type="array"
Full structural rule: #/$defs/drawBufferLayout
{
"items": {
"oneOf": [
{
"const": "disabled"
},
{
"minimum": 0,
"type": "integer"
}
]
},
"type": "array"
}Complete examples
Sources and machine records
Coverage inventory · Schema v5 · Catalog v2 · Completion v2
schema-v3 · schema-v4 · schema-v5 · completion-v1 · completion-v2 · temporal · settings-guide ·