Skip to content

Programs and shader sources ​

Behavior and constraints ​

graphics supplies vertex/fragment; compute supplies compute. Stage files cannot be mixed. Pass programs and command program reference the ID, and invocation Programs must be visible to their Pass. Sources, includes, defines, option/capability inputs and compile context form a frozen closure. Files edited later cannot mutate a queued candidate.

compileMode is legacyCustom, officialCompatible or manifestDriven. Check the resolved host/Program context for defaults and restrictions; an accepted token does not imply support on every host. officialCompatible follows published host vertex/macro conventions, including Terrain semantic comments and OPENGL_POSITION_FIX. Pack includes cannot cross into the BuiltIn owner. The materials virtual include is an explicit ABI entry, not arbitrary built-in file access.

defines accepts fixed values or option/capability maps; variants supplies IDs and define sets. Mapping and null behavior follow Schema/resolver rules without executing author code. Uniforms, blocks, vertex inputs and fragment outputs must agree with bindings, sceneBindings, targets and drawBuffers.

Program bindings/targets/drawBuffers/state/engineDrawState describe their supported invocation boundary. Check command-owned invocation metadata in the resolved result; duplicated declarations do not imply automatic merging of every owner. Static reflection may lack compilation context. A frozen source closure alone does not prove driver compilation or an executable generation.

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.

program · v5 ​

Field / branchPresence in this objectStructural constraints
bindingsoptional here—
compileModeoptional hereenum=["legacyCustom","officialCompatible","manifestDriven"]
computeoptional here$ref="#/$defs/relativePath"
definesoptional heretype="object"; additionalProperties={"$ref":"#/$defs/defineValue"}
drawBuffersoptional here—
engineDrawStateoptional here—
fragmentoptional here$ref="#/$defs/relativePath"
idrequired$ref="#/$defs/identifier"
kindrequiredenum=["graphics","compute"]
stateoptional here—
targetsoptional here—
variantsoptional heretype="array"; items=#/$defs/variant
vertexoptional here$ref="#/$defs/relativePath"
Full structural rule: #/$defs/program
json
{
  "additionalProperties": false,
  "allOf": [
    {
      "if": {
        "properties": {
          "kind": {
            "const": "graphics"
          }
        },
        "required": [
          "kind"
        ]
      },
      "then": {
        "allOf": [
          {
            "not": {
              "anyOf": [
                {
                  "required": [
                    "compute"
                  ]
                }
              ]
            }
          }
        ],
        "required": [
          "vertex",
          "fragment"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "kind": {
            "const": "compute"
          }
        },
        "required": [
          "kind"
        ]
      },
      "then": {
        "allOf": [
          {
            "not": {
              "anyOf": [
                {
                  "required": [
                    "vertex"
                  ]
                },
                {
                  "required": [
                    "fragment"
                  ]
                },
                {
                  "required": [
                    "compileMode"
                  ]
                }
              ]
            }
          }
        ],
        "required": [
          "compute"
        ]
      }
    }
  ],
  "properties": {
    "bindings": {
      "not": {}
    },
    "compileMode": {
      "enum": [
        "legacyCustom",
        "officialCompatible",
        "manifestDriven"
      ]
    },
    "compute": {
      "$ref": "#/$defs/relativePath"
    },
    "defines": {
      "additionalProperties": {
        "$ref": "#/$defs/defineValue"
      },
      "propertyNames": {
        "$ref": "#/$defs/glslIdentifier"
      },
      "type": "object"
    },
    "drawBuffers": {
      "not": {}
    },
    "engineDrawState": {
      "not": {}
    },
    "fragment": {
      "$ref": "#/$defs/relativePath"
    },
    "id": {
      "$ref": "#/$defs/identifier"
    },
    "kind": {
      "enum": [
        "graphics",
        "compute"
      ]
    },
    "state": {
      "not": {}
    },
    "targets": {
      "not": {}
    },
    "variants": {
      "items": {
        "$ref": "#/$defs/variant"
      },
      "type": "array"
    },
    "vertex": {
      "$ref": "#/$defs/relativePath"
    }
  },
  "required": [
    "id",
    "kind"
  ],
  "type": "object"
}

variant · v5 ​

Field / branchPresence in this objectStructural constraints
definesrequiredtype="object"; additionalProperties={"$ref":"#/$defs/defineValue"}
idrequired$ref="#/$defs/identifier"
Full structural rule: #/$defs/variant
json
{
  "additionalProperties": false,
  "properties": {
    "defines": {
      "additionalProperties": {
        "$ref": "#/$defs/defineValue"
      },
      "propertyNames": {
        "$ref": "#/$defs/glslIdentifier"
      },
      "type": "object"
    },
    "id": {
      "$ref": "#/$defs/identifier"
    }
  },
  "required": [
    "id",
    "defines"
  ],
  "type": "object"
}

defineValue · v5 ​

oneOf: 2

Full structural rule: #/$defs/defineValue
json
{
  "oneOf": [
    {
      "$ref": "#/$defs/nullableDefineValue"
    },
    {
      "$ref": "#/$defs/defineBinding"
    }
  ]
}

defineBinding · v5 ​

Field / branchPresence in this objectStructural constraints
capabilityoptional here$ref="#/$defs/identifier"
mapoptional heretype="object"; additionalProperties={"$ref":"#/$defs/nullableDefineValue"}
optionoptional here$ref="#/$defs/identifier"
Full structural rule: #/$defs/defineBinding
json
{
  "additionalProperties": false,
  "allOf": [
    {
      "oneOf": [
        {
          "required": [
            "option"
          ]
        },
        {
          "required": [
            "capability"
          ]
        }
      ]
    }
  ],
  "properties": {
    "capability": {
      "$ref": "#/$defs/identifier"
    },
    "map": {
      "additionalProperties": {
        "$ref": "#/$defs/nullableDefineValue"
      },
      "type": "object"
    },
    "option": {
      "$ref": "#/$defs/identifier"
    }
  },
  "type": "object"
}

nullableDefineValue · v5 ​

type=["string","boolean","integer","number","null"]

Full structural rule: #/$defs/nullableDefineValue
json
{
  "type": [
    "string",
    "boolean",
    "integer",
    "number",
    "null"
  ]
}

glslIdentifier · v5 ​

type="string"; pattern="^[A-Za-z_][A-Za-z0-9_]*$"

Full structural rule: #/$defs/glslIdentifier
json
{
  "pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
  "type": "string"
}

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