24 lines
2.0 KiB
Markdown
24 lines
2.0 KiB
Markdown
---
|
|
code: SHD009
|
|
scope: asset
|
|
severity: error
|
|
title: The graphics driver could not compile, link or validate a shader candidate.
|
|
---
|
|
|
|
The renderer rejected a prepared shader variant.
|
|
|
|
**Fix.** Find the named asset and correct the specific compile, layout or consumer error in the full cause before retrying that variant.
|
|
|
|
## Find the source and cause
|
|
|
|
The code identifies the failed candidate, not necessarily a syntax error in the source. Read the full cause: it may be a driver compile log, an incompatible uniform layout, an old prepared shader or a nested [MAT004](ref:MAT004) material/domain mismatch.
|
|
|
|
1. Select the Console message and read its details. Keep the `code`, `asset`, `file`, `line`, graphics backend and complete `err` text together. A line of `0` means no source line was identified; do not treat it as the first line of the shader.
|
|
2. Find that AssetID or source path in Assets. Inspect the material's shader reference and the component or Post Process effect that consumes it. A failed sprite preview does not prove that a postfx shader is invalid for camera post-processing.
|
|
3. If the nested cause says `MAT004: postfx shader cannot draw sprite geometry`, correct the consumer: use the postfx material in the camera's Custom effect, not on SpriteRenderer. Do not change `#pragma postfx` to a sprite domain merely to silence this message.
|
|
4. For a compiler or link error, follow the reported source file and mapped line. For a layout mismatch, compare the reported member, type and offset with the shader/material declaration. If the message explicitly identifies a legacy prepared shader, reimport that source with the matching engine version.
|
|
|
|
## Verify the fix
|
|
|
|
Run the same consumer and shader variant again on the affected backend. Verify the intended visual effect and that no new SHD009 is reported. Reimporting every asset is not a diagnosis and cannot fix a domain mismatch. If it persists, attach the material, shader and includes, the smallest scene, engine version, backend and driver log to the reproduction.
|