-
Bug
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
6.10.0
-
None
When providing a non existent file to a Shader component it attempts to compile it with the error:
Failed to read shader code from :/qt/qml/debug_qml/nosuchfile.frag
QSpirvCompiler: Failed to parse shader
Failed to compile fragment shader: ERROR: :193: 'qt_customMain' : no matching overloaded function found
ERROR: :193: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
"effect pipeline-->DEFAULT>:9aed8cb44c112cc5a5cc98b4840ddf50f28eac47:1:1:0"
It took me about one hour to realize this mistake, because I had assumed that I was missing qt modules, or had a broken installation. The engine should realize that the provided file does not exist, not even attempt to compile the shader and print a proper warning/error to the user.
Sample code:
import QtQuick import QtQuick3D Window { visible: true Shader { id: shd stage: Shader.Fragment shader: "nosuchfile.frag" } View3D { anchors.fill: parent OrthographicCamera {} environment: SceneEnvironment { effects: Effect { passes: Pass { shaders: shd } } } } }