Skip to content

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 / branchPresence in this objectStructural constraints
colorsoptional heretype="array"; uniqueItems=true; items=#/$defs/colorTarget
depthoptional here$ref="#/$defs/depthTarget"
Full structural rule: #/$defs/targets
json
{
  "additionalProperties": false,
  "minProperties": 1,
  "properties": {
    "colors": {
      "items": {
        "$ref": "#/$defs/colorTarget"
      },
      "type": "array",
      "uniqueItems": true
    },
    "depth": {
      "$ref": "#/$defs/depthTarget"
    }
  },
  "type": "object"
}

colorTarget · v5 ​

Field / branchPresence in this objectStructural constraints
clearValueoptional heretype="array"; minItems=4; maxItems=4
framesAgooptional heretype="integer"; minimum=1
loadOprequiredenum=["load","clear","dontCare"]
locationrequiredtype="integer"; minimum=0
resourcerequired$ref="#/$defs/identifier"
storeOprequiredenum=["store","dontCare"]
viewoptional hereenum=["dawnlight:direct","dawnlight:history/current","dawnlight:history/previous","dawnlight:shadow/consumer","dawnlight:shadow/producer"]
Full structural rule: #/$defs/colorTarget
json
{
  "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 / branchPresence in this objectStructural constraints
clearValueoptional heretype="number"; minimum=0; maximum=1
framesAgooptional heretype="integer"; minimum=1
loadOprequiredenum=["load","clear","dontCare"]
resourcerequired$ref="#/$defs/identifier"
storeOprequiredenum=["store","dontCare"]
viewoptional hereenum=["dawnlight:direct","dawnlight:history/current","dawnlight:history/previous","dawnlight:shadow/consumer","dawnlight:shadow/producer"]
Full structural rule: #/$defs/depthTarget
json
{
  "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 / branchPresence in this objectStructural constraints
blendoptional hereenum=["inherit","opaque","alphaBlend","nonPremultiplied"]
blendTargetsoptional heretype="array"; minItems=1; uniqueItems=true
depthoptional hereenum=["inherit","default","depthWrite","depthTestWriteLess","disabled"]
rasterizeroptional hereenum=["inherit","cullCounterClockwiseScissor","cullClockwiseScissor","cullNoneScissor"]
Full structural rule: #/$defs/state
json
{
  "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
json
{
  "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 ·

ShaderPackManifestLoader.cs

Author documentation · Manifest v5 / Scene ABI v2