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 / branch | Presence in this object | Structural constraints |
|---|---|---|
oneOf[0].content | optional here | $ref="#/$defs/content" |
oneOf[0].format | optional here | $ref="#/$defs/nonEmptyString" |
oneOf[0].historyCapacity | optional here | type="integer"; minimum=2 |
oneOf[0].id | required | $ref="#/$defs/identifier" |
oneOf[0].kind | required | enum=["texture2D","textureCube"] |
oneOf[0].lifetime | required | oneOf: 2 |
oneOf[0].sampling | optional here | $ref="#/$defs/sampling" |
oneOf[0].size | optional here | $ref="#/$defs/size" |
oneOf[1].byteSize | optional here | type="integer"; minimum=1 |
oneOf[1].content | optional here | $ref="#/$defs/content" |
oneOf[1].id | required | $ref="#/$defs/identifier" |
oneOf[1].kind | required | const="buffer" |
oneOf[1].lifetime | required | oneOf: 2 |
oneOf[1].usage | optional here | enum=["staticDraw","dynamicDraw","streamDraw"] |
Full structural rule: #/$defs/resource
{
"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 / branch | Presence in this object | Structural constraints |
|---|---|---|
oneOf[1].type | required | const="undefined" |
oneOf[2].type | required | const="external" |
oneOf[3].type | required | const="clear" |
oneOf[3].value | required | oneOf: 2 |
oneOf[4].encoding | optional here | enum=["image","raw"] |
oneOf[4].faces | optional here | type="object"; additionalProperties=false |
oneOf[4].faces.negativeX | required | $ref="#/$defs/relativePath" |
oneOf[4].faces.negativeY | required | $ref="#/$defs/relativePath" |
oneOf[4].faces.negativeZ | required | $ref="#/$defs/relativePath" |
oneOf[4].faces.positiveX | required | $ref="#/$defs/relativePath" |
oneOf[4].faces.positiveY | required | $ref="#/$defs/relativePath" |
oneOf[4].faces.positiveZ | required | $ref="#/$defs/relativePath" |
oneOf[4].path | optional here | $ref="#/$defs/relativePath" |
oneOf[4].type | required | const="asset" |
oneOf[5].generator | required | $ref="#/$defs/identifier" |
oneOf[5].type | required | const="generated" |
oneOf[5].version | required | $ref="#/$defs/positiveVersion" |
oneOf[6].service | required | $ref="#/$defs/identifier" |
oneOf[6].type | required | const="service" |
oneOf[6].version | required | $ref="#/$defs/positiveVersion" |
oneOf[7].type | required | const="materialTable" |
oneOf[7].version | required | const=1 |
Full structural rule: #/$defs/content
{
"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 / branch | Presence in this object | Structural constraints |
|---|---|---|
height | optional here | type="integer"; minimum=1 |
mode | required | enum=["absolute","viewport","output"] |
scale | optional here | type="array"; minItems=2; maxItems=2 |
width | optional here | type="integer"; minimum=1 |
Full structural rule: #/$defs/size
{
"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 / branch | Presence in this object | Structural constraints |
|---|---|---|
magFilter | optional here | enum=["nearest","linear"] |
minFilter | optional here | enum=["nearest","linear"] |
mipLevels | optional here | type="integer"; minimum=1 |
wrapS | optional here | enum=["repeat","clampToEdge","mirroredRepeat"] |
wrapT | optional here | enum=["repeat","clampToEdge","mirroredRepeat"] |
Full structural rule: #/$defs/sampling
{
"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 / branch | Presence in this object | Structural constraints |
|---|---|---|
capacity | required | type="integer"; minimum=2 |
kind | required | const="history" |
Full structural rule: #/$defs/historyLifetime
{
"additionalProperties": false,
"properties": {
"capacity": {
"minimum": 2,
"type": "integer"
},
"kind": {
"const": "history"
}
},
"required": [
"kind",
"capacity"
],
"type": "object"
}resourceView · v5
| Field / branch | Presence in this object | Structural constraints |
|---|---|---|
framesAgo | optional here | type="integer"; minimum=1 |
resource | required | $ref="#/$defs/identifier" |
view | optional here | enum=["dawnlight:direct","dawnlight:history/current","dawnlight:history/previous","dawnlight:shadow/consumer","dawnlight:shadow/producer"] |
Full structural rule: #/$defs/resourceView
{
"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 ·