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
- [Android] Error "Blitter is already initialized" is present when Adaptive Probe Volumes are used with OpenGLES3
- VFX Graph effect instance stops rendering when a second instance of the same effect starts 2 frames later
- Operations on the Color32 array are not reflected in WebGL Player when HDR is off
- Rigidbody moves away from the original GameObject when Center of Mass is set in every frame
- WebGL Player does not proceed beyond logo screen when "Target WebAssembly 2023" is enabled
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.