How to reproduce:
- Create a new project using the "High Definition 3D" template
- In the Project window, right-click and select "Create" > "Shader Graph" > "HDRP" > "Lit Shader Graph"
- Open the created Shader Graph asset
- In the Graph Inspector, open the "Graph Settings" tab and set "Material" to "TerrainLit"
- Add a "Main Light Direction" node and connect its output to "Base Color" in the Fragment context
- In the Shader Graph toolbar, select "Save Asset"
- In the Project window, expand the Shader Graph asset and select the "Hidden/_BaseMapGen" sub-asset
- Observe the Inspector
Actual result: The Inspector reports "undeclared identifier 'SHADERGRAPH_MAIN_LIGHT_DIRECTION'" once per generated pass, while the main shader from the same graph compiles
Expected result: The base map shader compiles without errors, the same as the main shader from the same graph
Reproducible with: 6000.3.0a5, 6000.3.23f1, 6000.5.11f1, 6000.6.0f1, 6000.7.0a6, 7000.0.0a1
Could not test with: 6000.0.0f1, 6000.0.83f1 (the TerrainLit Shader Graph target does not exist in 6000.0)
Reproducible on: Windows 11
Not reproducible on: No other environments tested