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

qt_add_shaders fails with "No GLSL shader code found"

    XMLWordPrintable

Details

    • Bug
    • Resolution: Moved
    • P2: Important
    • None
    • 6.3.0
    • Build System: CMake
    • None
    • Linux/X11

    Description

      I tried to use qt_add_shaders in my CMakeList, but the application fails with " No GLSL shader code found (versions tried: QList(460, 450, 440, 430, 420, 410, 400, 330, 150, 140, 130, 120) ) in baked shader QShader(stage=0 shaders=QList(ShaderKey(1 Version(440 QFlags()) 0), ShaderKey(0 Version(100 QFlags()) 0)) desc.isValid=true) "

       

      The application works if I compile the shaders manually and include them in the resource.

       

      I checked the shader is found in the  application resource (i.e. path is right) and dumped the generated qsb file.  Thus, I didn't find an obvious error and explanation.

       

      qt_add_qml_module(scenegraph
          URI Scene
          VERSION 1.0
          QML_FILES
              main.qml
          RESOURCES
          #    shaders/line.frag.qsb
          #    shaders/line.vert.qsb
          RESOURCE_PREFIX "/scenegraph/scene"
          NO_RESOURCE_TARGET_PATH
      )
      
      # command to compile shader
      # qsb -b --glsl "150,120,100 es" --hlsl 50 --msl 12 -o xxx.vert.qsb xxx.vert
      
      qt_add_shaders(scenegraph "scenegraph_shaders"
        GLSL "150,120,100 es"
        NOHLSL
        NOMSL
        PREFIX "/scenegraph/scene/"
        FILES
        shaders/line.vert
        shaders/line.frag
      )
      

      Attachments

        Issue Links

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

          Activity

            People

              qtbuildsystem Qt Build System Team
              fabricesalvaire fabrice salvaire
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes