Search Issue Tracker
Won't Fix
Votes
0
Found in
2018.1.0b1
2018.2.9f1
Issue ID
1085660
Regression
Yes
[ScriptedImporter] Imported Shaders do not show errors in the Object
Reproduction steps:
1. Open "ShaderImporter.zip" project
2. Select and Reimport "shaderToImport"
3. See "Scripted Shader Imported(Script)" -> "Errors" -> "Did not find shader kernel 'vert______error' to compile"
4. "Compile and show code"
5. The Error is now displayed on the Object
Expected Result: The error is displayed from the moment the Shader is imported
Actual Result: The error is displayed only when Compiled and Opened
Reproduced with: 2019.1.0a3, 2018.3.0b4, 2018.2.11f1, 2018.1.9f2, 2018.1.0b1
Did not reproduce on: 2018.1.0a7, 2017.4.12f1 (Seems like ScriptedImporter importing shaders only works from 2018.1.0b1)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Incorrect Shader keyword activation for Shadows when no Light is present in URP
- Editor freezes when loading a specific AssetBundle
- WebGPU builds with Multithreading enabled crash on Safari
- Set as Value in UI Builder doesn't work across all properties.
- Calculating time durations in RenderDoc with DX12 causes 'Device Lost error' popup
Resolution Note (2018.3.X):
Using "ShaderUtil.CreateShaderAsset("");" during a scripted importer "OnImportAsset" will not create a GUID. Shader error messages are saved in the "ShaderCache.db" using the GUID as a key, that is not available in this context.
The workaround of using an "AssetPostprocessor::OnPostprocessAllAssets" provides the functionality that is wanted, because during the "AssetPostprocessor::OnPostprocessAllAssets" the shader has been given a valid GUID and then the error will be correctly saved in the "ShaderCache.db" and displayed in the asset inspector as requested.