Add manifest support for pass declarations
This commit is contained in:
@@ -97,6 +97,7 @@ Optional fields:
|
||||
- `description`: display/help text for the shader library.
|
||||
- `category`: UI grouping label.
|
||||
- `entryPoint`: Slang function to call. Defaults to `shadeVideo`.
|
||||
- `passes`: advanced render-pass declarations. Omit this for normal single-pass shaders.
|
||||
- `textures`: texture assets to load and expose as samplers.
|
||||
- `fonts`: packaged font assets for live text parameters.
|
||||
- `temporal`: history-buffer requirements.
|
||||
@@ -110,6 +111,52 @@ Shader-visible identifiers must be valid Slang-style identifiers:
|
||||
|
||||
Use letters, numbers, and underscores only, and start with a letter or underscore. For example, `logoTexture` is valid; `logo-texture` is not valid as a shader-visible texture ID.
|
||||
|
||||
## Render Passes
|
||||
|
||||
Most shaders should omit `passes`. The runtime then creates one implicit pass:
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "main",
|
||||
"source": "shader.slang",
|
||||
"entryPoint": "shadeVideo",
|
||||
"output": "layerOutput"
|
||||
}
|
||||
```
|
||||
|
||||
Advanced shaders may declare explicit passes:
|
||||
|
||||
```json
|
||||
{
|
||||
"passes": [
|
||||
{
|
||||
"id": "blurX",
|
||||
"source": "blur-x.slang",
|
||||
"entryPoint": "blurHorizontal",
|
||||
"inputs": ["layerInput"],
|
||||
"output": "blurredX"
|
||||
},
|
||||
{
|
||||
"id": "final",
|
||||
"source": "final.slang",
|
||||
"entryPoint": "finish",
|
||||
"inputs": ["blurredX"],
|
||||
"output": "layerOutput"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Pass fields:
|
||||
|
||||
- `id`: required pass identifier. It must be a valid shader identifier and unique inside the package.
|
||||
- `source`: required Slang source path relative to the package directory.
|
||||
- `entryPoint`: optional Slang function for this pass. Defaults to the package-level `entryPoint`.
|
||||
- `inputs`: optional list of named inputs. Current reserved names include `layerInput` and future pass output names.
|
||||
- `output`: optional output name. Use `layerOutput` for the final visible layer result.
|
||||
|
||||
Current runtime note: pass manifests are parsed and every declared pass is Slang-validated/compiled, but execution still uses the first pass until multipass render-target routing is enabled. Existing single-pass shaders are unaffected.
|
||||
|
||||
## Slang Entry Point
|
||||
|
||||
Your shader file must implement the manifest `entryPoint`.
|
||||
|
||||
Reference in New Issue
Block a user