Skip to content

Bindings, semantics and comparison sampling ​

Behavior and constraints ​

Registered examples identify each binding category. This pinned set has no positive uniformBuffer runtime evidence. The separate complete UBO/materialTable negative fixture verifies DLMAT1002's combination restriction. It is not a working preset; the UBO token does not allow material tables to be read as UBOs.

Resource kind/symbol/binding/resource selects a GLSL interface and resource slot. sampler2D, samplerCube and sampler2DShadow use texture units; image2D uses image units; uniformBuffer/storageBuffer use their block-binding namespaces. image2D and storageBuffer require access; ordinary samplers/UBOs do not accept it. Arrays, types, device slot limits and actual driver interfaces still need validation.

view/framesAgo selects direct, history or Service views, with valid distance and fallback contracts for previous history. Symbols must not collide across resource, semantic, Scene and custom binding owners. semantics connects semantic/version; Scene uses contract/version/frequency; customBindings connects variable/required to typed data. These owners cannot redefine one another's values.

Scene frequency is frame/view/batch/draw and must match the Catalog. Texture/block slots follow slotKind; adding a slot to a numeric value does not make it a texture. See Catalog for types, source/target spaces and required metadata.

v5 sampler2DShadow comparison v1 uses version=1, compare=lessEqual and nearest/linear filter, with clampToEdge and mip 0. It accepts only direct persistent depth texture2D backed by D24/UInt or D32F/Float. Color, cube, history, fallback and Service views are rejected. The uniform must be active, scalar and exactly typed; even length-one arrays fail. Raw/compare consumers of the same image use distinct symbols/units and share the texture-unit namespace with Scene textures.

Comparison requires a graphics boundary with ComparisonSampling support: command-list graphics or the manifest fullscreen host. Compute and unsupported legacy hosts reject it. Sampler objects belong to the candidate; bindings restore on exit/failure, and device recovery rebuilds the generation. Structural acceptance does not replace driver-limit or FBO checks.

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.

binding · v5 ​

Field / branchPresence in this objectStructural constraints
accessoptional hereenum=["readOnly","writeOnly","readWrite"]
bindingrequiredtype="integer"; minimum=0
comparisonoptional heretype="object"; additionalProperties=false
comparison.comparerequiredconst="lessEqual"
comparison.filterrequiredenum=["nearest","linear"]
comparison.versionrequiredconst=1
enabledWhenoptional heretype="array"; items=#/$defs/condition
fallbackoptional hereoneOf: 2
framesAgooptional heretype="integer"; minimum=1
kindrequiredenum=["sampler2D","sampler2DShadow","samplerCube","image2D","uniformBuffer","storageBuffer"]
resourcerequired$ref="#/$defs/identifier"
symbolrequired$ref="#/$defs/glslIdentifier"
viewoptional hereenum=["dawnlight:direct","dawnlight:history/current","dawnlight:history/previous","dawnlight:shadow/consumer","dawnlight:shadow/producer"]
Full structural rule: #/$defs/binding
json
{
  "additionalProperties": false,
  "allOf": [
    {
      "if": {
        "properties": {
          "kind": {
            "enum": [
              "image2D",
              "storageBuffer"
            ]
          }
        }
      },
      "then": {
        "required": [
          "access"
        ]
      }
    },
    {
      "if": {
        "not": {
          "properties": {
            "kind": {
              "enum": [
                "image2D",
                "storageBuffer"
              ]
            }
          }
        }
      },
      "then": {
        "not": {
          "anyOf": [
            {
              "required": [
                "access"
              ]
            }
          ]
        }
      }
    },
    {
      "if": {
        "properties": {
          "view": {
            "const": "dawnlight:history/previous"
          }
        },
        "required": [
          "view"
        ]
      },
      "then": {
        "required": [
          "framesAgo"
        ]
      }
    },
    {
      "if": {
        "not": {
          "properties": {
            "view": {
              "const": "dawnlight:history/previous"
            }
          },
          "required": [
            "view"
          ]
        }
      },
      "then": {
        "not": {
          "anyOf": [
            {
              "required": [
                "framesAgo"
              ]
            }
          ]
        }
      }
    },
    {
      "if": {
        "properties": {
          "kind": {
            "const": "sampler2DShadow"
          }
        },
        "required": [
          "kind"
        ]
      },
      "then": {
        "allOf": [
          {
            "not": {
              "anyOf": [
                {
                  "required": [
                    "fallback"
                  ]
                },
                {
                  "required": [
                    "framesAgo"
                  ]
                }
              ]
            }
          },
          {
            "properties": {
              "view": {
                "const": "dawnlight:direct"
              }
            }
          }
        ],
        "required": [
          "comparison"
        ]
      }
    },
    {
      "if": {
        "not": {
          "properties": {
            "kind": {
              "const": "sampler2DShadow"
            }
          },
          "required": [
            "kind"
          ]
        }
      },
      "then": {
        "not": {
          "anyOf": [
            {
              "required": [
                "comparison"
              ]
            }
          ]
        }
      }
    }
  ],
  "properties": {
    "access": {
      "enum": [
        "readOnly",
        "writeOnly",
        "readWrite"
      ]
    },
    "binding": {
      "minimum": 0,
      "type": "integer"
    },
    "comparison": {
      "additionalProperties": false,
      "properties": {
        "compare": {
          "const": "lessEqual"
        },
        "filter": {
          "enum": [
            "nearest",
            "linear"
          ]
        },
        "version": {
          "const": 1
        }
      },
      "required": [
        "version",
        "filter",
        "compare"
      ],
      "type": "object"
    },
    "enabledWhen": {
      "items": {
        "$ref": "#/$defs/condition"
      },
      "type": "array"
    },
    "fallback": {
      "oneOf": [
        {
          "$ref": "#/$defs/identifier"
        },
        {
          "$ref": "#/$defs/resourceView"
        }
      ]
    },
    "framesAgo": {
      "minimum": 1,
      "type": "integer"
    },
    "kind": {
      "enum": [
        "sampler2D",
        "sampler2DShadow",
        "samplerCube",
        "image2D",
        "uniformBuffer",
        "storageBuffer"
      ]
    },
    "resource": {
      "$ref": "#/$defs/identifier"
    },
    "symbol": {
      "$ref": "#/$defs/glslIdentifier"
    },
    "view": {
      "enum": [
        "dawnlight:direct",
        "dawnlight:history/current",
        "dawnlight:history/previous",
        "dawnlight:shadow/consumer",
        "dawnlight:shadow/producer"
      ]
    }
  },
  "required": [
    "kind",
    "symbol",
    "binding",
    "resource"
  ],
  "type": "object"
}

semantic · v5 ​

Field / branchPresence in this objectStructural constraints
enabledWhenoptional heretype="array"; items=#/$defs/condition
semanticrequired$ref="#/$defs/identifier"
symbolrequired$ref="#/$defs/glslIdentifier"
versionrequired$ref="#/$defs/positiveVersion"
Full structural rule: #/$defs/semantic
json
{
  "additionalProperties": false,
  "properties": {
    "enabledWhen": {
      "items": {
        "$ref": "#/$defs/condition"
      },
      "type": "array"
    },
    "semantic": {
      "$ref": "#/$defs/identifier"
    },
    "symbol": {
      "$ref": "#/$defs/glslIdentifier"
    },
    "version": {
      "$ref": "#/$defs/positiveVersion"
    }
  },
  "required": [
    "symbol",
    "semantic",
    "version"
  ],
  "type": "object"
}

sceneBinding · v5 ​

Field / branchPresence in this objectStructural constraints
bindingoptional heretype="integer"; minimum=0
contractrequired$ref="#/$defs/identifier"
frequencyrequiredenum=["frame","view","batch","draw"]
symbolrequired$ref="#/$defs/glslIdentifier"
versionrequired$ref="#/$defs/positiveVersion"
Full structural rule: #/$defs/sceneBinding
json
{
  "additionalProperties": false,
  "properties": {
    "binding": {
      "minimum": 0,
      "type": "integer"
    },
    "contract": {
      "$ref": "#/$defs/identifier"
    },
    "frequency": {
      "enum": [
        "frame",
        "view",
        "batch",
        "draw"
      ]
    },
    "symbol": {
      "$ref": "#/$defs/glslIdentifier"
    },
    "version": {
      "$ref": "#/$defs/positiveVersion"
    }
  },
  "required": [
    "symbol",
    "contract",
    "version",
    "frequency"
  ],
  "type": "object"
}

customBinding · v5 ​

Field / branchPresence in this objectStructural constraints
requiredoptional heretype="boolean"
symbolrequiredtype="string"; pattern="^[A-Za-z_][A-Za-z0-9_]*$"
variablerequired$ref="#/$defs/dataId"
Full structural rule: #/$defs/customBinding
json
{
  "additionalProperties": false,
  "properties": {
    "required": {
      "type": "boolean"
    },
    "symbol": {
      "pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
      "type": "string"
    },
    "variable": {
      "$ref": "#/$defs/dataId"
    }
  },
  "required": [
    "symbol",
    "variable"
  ],
  "type": "object"
}

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 · MaterialTableShaderContract.cs

Author documentation · Manifest v5 / Scene ABI v2