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
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
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.