Skip to content

Resources, content and lifetime ​

Behavior and constraints ​

Ordinary buffers support only persistent lifetime here; usage is staticDraw / dynamicDraw / streamDraw. Content permits undefined, generated or service, plus v5 materialTable. Ordinary buffers reject asset/clear/external even though the general content Schema lists them. Active undefined-content readers still need a producer. Every materialTable consumer must be a read-only SSBO; UBO access is rejected in the complete negative fixture.

Resource IDs resolve inside a candidate. kind is texture2D, textureCube or buffer. Texture size uses absolute width/height, viewport or output and the applicable scale; buffers use byteSize and usage instead of texture format/size. See Catalog for color/depth formats, versions and bytesPerPixel. Capacity estimates exclude driver overhead.

lifetime is persistent, frame, transient, history or external. History uses kind/capacity or the applicable historyCapacity, with capacity at least 2. current/previous views and framesAgo must satisfy ring capacity and view contracts. historyCommit is a lifecycle event; frame-boundary advancement happens once and skipped producers do not fabricate new history. Resizing and generation/device invalidation cannot be repaired by reading stale slots.

content is undefined/external or an object selecting clear, asset, generated or service; v5 adds materialTable. undefined does not guarantee zero initialization. clear value shape must match the resource. Asset path and six cube faces are alternatives; encoding is image/raw, with additional format/size restrictions. Generated generator/version and service/version require an active Service with matching content-provider support. A Catalog ID does not instantiate arbitrary C# code. materialTable requires a supported buffer and computes its capacity from the final layout instead of an authored byteSize.

Omitted sampling retains nearest filtering, repeat wrapping and one mip. Explicit filters, wraps and mipLevels still need resource, format and uploader support; decoded image size must match the declaration. Comparison sampling has a separate strict combination contract.

Preparation is transactional: active closure → candidate resources/views/FBOs → allocator clear/asset → Service creation/initialization → generated/service content → Program validation → whole-generation publication. Rollback stops Services in reverse order before releasing resources. A candidate cannot borrow partial allocations from the live 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.

resource · v5 ​

Field / branchPresence in this objectStructural constraints
oneOf[0].contentoptional here$ref="#/$defs/content"
oneOf[0].formatoptional here$ref="#/$defs/nonEmptyString"
oneOf[0].historyCapacityoptional heretype="integer"; minimum=2
oneOf[0].idrequired$ref="#/$defs/identifier"
oneOf[0].kindrequiredenum=["texture2D","textureCube"]
oneOf[0].lifetimerequiredoneOf: 2
oneOf[0].samplingoptional here$ref="#/$defs/sampling"
oneOf[0].sizeoptional here$ref="#/$defs/size"
oneOf[1].byteSizeoptional heretype="integer"; minimum=1
oneOf[1].contentoptional here$ref="#/$defs/content"
oneOf[1].idrequired$ref="#/$defs/identifier"
oneOf[1].kindrequiredconst="buffer"
oneOf[1].lifetimerequiredoneOf: 2
oneOf[1].usageoptional hereenum=["staticDraw","dynamicDraw","streamDraw"]
Full structural rule: #/$defs/resource
json
{
  "oneOf": [
    {
      "additionalProperties": false,
      "allOf": [
        {
          "not": {
            "allOf": [
              {
                "properties": {
                  "content": {
                    "allOf": [
                      {
                        "properties": {
                          "type": {
                            "const": "materialTable"
                          }
                        },
                        "required": [
                          "type"
                        ]
                      }
                    ],
                    "type": "object"
                  }
                }
              }
            ],
            "required": [
              "content"
            ]
          }
        }
      ],
      "properties": {
        "content": {
          "$ref": "#/$defs/content"
        },
        "format": {
          "$ref": "#/$defs/nonEmptyString"
        },
        "historyCapacity": {
          "minimum": 2,
          "type": "integer"
        },
        "id": {
          "$ref": "#/$defs/identifier"
        },
        "kind": {
          "enum": [
            "texture2D",
            "textureCube"
          ]
        },
        "lifetime": {
          "oneOf": [
            {
              "enum": [
                "persistent",
                "frame",
                "transient",
                "history",
                "external"
              ]
            },
            {
              "$ref": "#/$defs/historyLifetime"
            }
          ]
        },
        "sampling": {
          "$ref": "#/$defs/sampling"
        },
        "size": {
          "$ref": "#/$defs/size"
        }
      },
      "required": [
        "id",
        "kind",
        "lifetime"
      ],
      "type": "object"
    },
    {
      "additionalProperties": false,
      "allOf": [
        {
          "if": {
            "allOf": [
              {
                "properties": {
                  "content": {
                    "allOf": [
                      {
                        "properties": {
                          "type": {
                            "const": "materialTable"
                          }
                        },
                        "required": [
                          "type"
                        ]
                      }
                    ],
                    "type": "object"
                  }
                }
              }
            ],
            "required": [
              "content"
            ]
          },
          "then": {
            "not": {
              "anyOf": [
                {
                  "required": [
                    "byteSize"
                  ]
                }
              ]
            }
          }
        },
        {
          "else": {
            "required": [
              "byteSize"
            ]
          },
          "if": {
            "allOf": [
              {
                "properties": {
                  "content": {
                    "allOf": [
                      {
                        "properties": {
                          "type": {
                            "const": "materialTable"
                          }
                        },
                        "required": [
                          "type"
                        ]
                      }
                    ],
                    "type": "object"
                  }
                }
              }
            ],
            "required": [
              "content"
            ]
          },
          "then": {
            "required": [
              "content"
            ]
          }
        }
      ],
      "properties": {
        "byteSize": {
          "minimum": 1,
          "type": "integer"
        },
        "content": {
          "$ref": "#/$defs/content"
        },
        "id": {
          "$ref": "#/$defs/identifier"
        },
        "kind": {
          "const": "buffer"
        },
        "lifetime": {
          "oneOf": [
            {
              "enum": [
                "persistent",
                "frame",
                "transient",
                "history",
                "external"
              ]
            },
            {
              "$ref": "#/$defs/historyLifetime"
            }
          ]
        },
        "usage": {
          "enum": [
            "staticDraw",
            "dynamicDraw",
            "streamDraw"
          ]
        }
      },
      "required": [
        "id",
        "kind",
        "lifetime"
      ],
      "type": "object"
    }
  ]
}

content · v5 ​

Field / branchPresence in this objectStructural constraints
oneOf[1].typerequiredconst="undefined"
oneOf[2].typerequiredconst="external"
oneOf[3].typerequiredconst="clear"
oneOf[3].valuerequiredoneOf: 2
oneOf[4].encodingoptional hereenum=["image","raw"]
oneOf[4].facesoptional heretype="object"; additionalProperties=false
oneOf[4].faces.negativeXrequired$ref="#/$defs/relativePath"
oneOf[4].faces.negativeYrequired$ref="#/$defs/relativePath"
oneOf[4].faces.negativeZrequired$ref="#/$defs/relativePath"
oneOf[4].faces.positiveXrequired$ref="#/$defs/relativePath"
oneOf[4].faces.positiveYrequired$ref="#/$defs/relativePath"
oneOf[4].faces.positiveZrequired$ref="#/$defs/relativePath"
oneOf[4].pathoptional here$ref="#/$defs/relativePath"
oneOf[4].typerequiredconst="asset"
oneOf[5].generatorrequired$ref="#/$defs/identifier"
oneOf[5].typerequiredconst="generated"
oneOf[5].versionrequired$ref="#/$defs/positiveVersion"
oneOf[6].servicerequired$ref="#/$defs/identifier"
oneOf[6].typerequiredconst="service"
oneOf[6].versionrequired$ref="#/$defs/positiveVersion"
oneOf[7].typerequiredconst="materialTable"
oneOf[7].versionrequiredconst=1
Full structural rule: #/$defs/content
json
{
  "oneOf": [
    {
      "enum": [
        "undefined",
        "external"
      ]
    },
    {
      "additionalProperties": false,
      "properties": {
        "type": {
          "const": "undefined"
        }
      },
      "required": [
        "type"
      ],
      "type": "object"
    },
    {
      "additionalProperties": false,
      "properties": {
        "type": {
          "const": "external"
        }
      },
      "required": [
        "type"
      ],
      "type": "object"
    },
    {
      "additionalProperties": false,
      "properties": {
        "type": {
          "const": "clear"
        },
        "value": {
          "oneOf": [
            {
              "items": {
                "type": "number"
              },
              "maxItems": 1,
              "minItems": 1,
              "type": "array"
            },
            {
              "items": {
                "type": "number"
              },
              "maxItems": 4,
              "minItems": 4,
              "type": "array"
            }
          ]
        }
      },
      "required": [
        "type",
        "value"
      ],
      "type": "object"
    },
    {
      "additionalProperties": false,
      "allOf": [
        {
          "oneOf": [
            {
              "required": [
                "path"
              ]
            },
            {
              "required": [
                "faces"
              ]
            }
          ]
        }
      ],
      "properties": {
        "encoding": {
          "enum": [
            "image",
            "raw"
          ]
        },
        "faces": {
          "additionalProperties": false,
          "properties": {
            "negativeX": {
              "$ref": "#/$defs/relativePath"
            },
            "negativeY": {
              "$ref": "#/$defs/relativePath"
            },
            "negativeZ": {
              "$ref": "#/$defs/relativePath"
            },
            "positiveX": {
              "$ref": "#/$defs/relativePath"
            },
            "positiveY": {
              "$ref": "#/$defs/relativePath"
            },
            "positiveZ": {
              "$ref": "#/$defs/relativePath"
            }
          },
          "required": [
            "positiveX",
            "negativeX",
            "positiveY",
            "negativeY",
            "positiveZ",
            "negativeZ"
          ],
          "type": "object"
        },
        "path": {
          "$ref": "#/$defs/relativePath"
        },
        "type": {
          "const": "asset"
        }
      },
      "required": [
        "type"
      ],
      "type": "object"
    },
    {
      "additionalProperties": false,
      "properties": {
        "generator": {
          "$ref": "#/$defs/identifier"
        },
        "type": {
          "const": "generated"
        },
        "version": {
          "$ref": "#/$defs/positiveVersion"
        }
      },
      "required": [
        "type",
        "generator",
        "version"
      ],
      "type": "object"
    },
    {
      "additionalProperties": false,
      "properties": {
        "service": {
          "$ref": "#/$defs/identifier"
        },
        "type": {
          "const": "service"
        },
        "version": {
          "$ref": "#/$defs/positiveVersion"
        }
      },
      "required": [
        "type",
        "service",
        "version"
      ],
      "type": "object"
    },
    {
      "additionalProperties": false,
      "properties": {
        "type": {
          "const": "materialTable"
        },
        "version": {
          "const": 1
        }
      },
      "required": [
        "type",
        "version"
      ],
      "type": "object"
    }
  ]
}

size · v5 ​

Field / branchPresence in this objectStructural constraints
heightoptional heretype="integer"; minimum=1
moderequiredenum=["absolute","viewport","output"]
scaleoptional heretype="array"; minItems=2; maxItems=2
widthoptional heretype="integer"; minimum=1
Full structural rule: #/$defs/size
json
{
  "additionalProperties": false,
  "allOf": [
    {
      "if": {
        "properties": {
          "mode": {
            "const": "absolute"
          }
        },
        "required": [
          "mode"
        ]
      },
      "then": {
        "allOf": [
          {
            "not": {
              "anyOf": [
                {
                  "required": [
                    "scale"
                  ]
                }
              ]
            }
          }
        ],
        "required": [
          "width",
          "height"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "mode": {
            "enum": [
              "viewport",
              "output"
            ]
          }
        }
      },
      "then": {
        "not": {
          "anyOf": [
            {
              "required": [
                "width"
              ]
            },
            {
              "required": [
                "height"
              ]
            }
          ]
        }
      }
    }
  ],
  "properties": {
    "height": {
      "minimum": 1,
      "type": "integer"
    },
    "mode": {
      "enum": [
        "absolute",
        "viewport",
        "output"
      ]
    },
    "scale": {
      "items": {
        "exclusiveMinimum": 0,
        "type": "number"
      },
      "maxItems": 2,
      "minItems": 2,
      "type": "array"
    },
    "width": {
      "minimum": 1,
      "type": "integer"
    }
  },
  "required": [
    "mode"
  ],
  "type": "object"
}

sampling · v5 ​

Field / branchPresence in this objectStructural constraints
magFilteroptional hereenum=["nearest","linear"]
minFilteroptional hereenum=["nearest","linear"]
mipLevelsoptional heretype="integer"; minimum=1
wrapSoptional hereenum=["repeat","clampToEdge","mirroredRepeat"]
wrapToptional hereenum=["repeat","clampToEdge","mirroredRepeat"]
Full structural rule: #/$defs/sampling
json
{
  "additionalProperties": false,
  "properties": {
    "magFilter": {
      "enum": [
        "nearest",
        "linear"
      ]
    },
    "minFilter": {
      "enum": [
        "nearest",
        "linear"
      ]
    },
    "mipLevels": {
      "minimum": 1,
      "type": "integer"
    },
    "wrapS": {
      "enum": [
        "repeat",
        "clampToEdge",
        "mirroredRepeat"
      ]
    },
    "wrapT": {
      "enum": [
        "repeat",
        "clampToEdge",
        "mirroredRepeat"
      ]
    }
  },
  "type": "object"
}

historyLifetime · v5 ​

Field / branchPresence in this objectStructural constraints
capacityrequiredtype="integer"; minimum=2
kindrequiredconst="history"
Full structural rule: #/$defs/historyLifetime
json
{
  "additionalProperties": false,
  "properties": {
    "capacity": {
      "minimum": 2,
      "type": "integer"
    },
    "kind": {
      "const": "history"
    }
  },
  "required": [
    "kind",
    "capacity"
  ],
  "type": "object"
}

resourceView · v5 ​

Field / branchPresence in this objectStructural constraints
framesAgooptional heretype="integer"; minimum=1
resourcerequired$ref="#/$defs/identifier"
viewoptional hereenum=["dawnlight:direct","dawnlight:history/current","dawnlight:history/previous","dawnlight:shadow/consumer","dawnlight:shadow/producer"]
Full structural rule: #/$defs/resourceView
json
{
  "additionalProperties": false,
  "allOf": [
    {
      "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"
              ]
            }
          ]
        }
      }
    }
  ],
  "properties": {
    "framesAgo": {
      "minimum": 1,
      "type": "integer"
    },
    "resource": {
      "$ref": "#/$defs/identifier"
    },
    "view": {
      "enum": [
        "dawnlight:direct",
        "dawnlight:history/current",
        "dawnlight:history/previous",
        "dawnlight:shadow/consumer",
        "dawnlight:shadow/producer"
      ]
    }
  },
  "required": [
    "resource"
  ],
  "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

Author documentation · Manifest v5 / Scene ABI v2