Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-141212

QML - Engine attempts to compile nonexistent shader file without warning

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.10.0
    • Quick: 3D
    • None
    • Linux/Wayland

      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 } }
              }
          }
      }
      

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.graphics.and.multimedia Qt Graphics Team
            jsentity Timur Vaydogan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes