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
- Volumetric fog shader variants are missing from build when "Strict Shader Variant Matching" is disabled
- Unnecessary modifications clutter the Scene when using a RectTransform driven by a LayoutGroup in a Prefab
- Files in the target folder are deleted without a proper warning when building an iOS project
- Character animation freezes when toggling animator on/off in a coroutine
- Certain textures are incorrectly marked in the render pass list when observed through Render Graph Viewer
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.