Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-32899 Update GLSL Editor / Parser
  3. QTCREATORBUG-26058

File wizards for GLSL files generate Qt 6-incompatible code

    XMLWordPrintable

Details

    • Sub-task
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • All Other Issues

    Description

      The GLSL file wizard offers only generating of Desktop OpenGL fragment/vertex shaders:

      attribute vec4 qt_Vertex;
      attribute vec4 qt_MultiTexCoord0;
      uniform mat4 qt_ModelViewProjectionMatrix;
      varying vec4 qt_TexCoord0;
      
      void main(void)
      {
          gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
          qt_TexCoord0 = qt_MultiTexCoord0;
      }
      

      Using that in a Qt 6-based project, will not work, because Qt 6 requires Vulkan style GLSL. Compilation with Qt's qsb tool https://doc.qt.io/qt-6/qtshadertools-qsb.html will fail:

      QSpirvCompiler: Failed to parse shader
      Shader baking failed: ERROR: #version: ES shaders for SPIR-V require version 310 or higher
      ERROR: xyz/bindingloops_qt6.vert:1: 'attribute' : Reserved word.
      ERROR: xyz/bindingloops_qt6.vert:1: 'attribute' : no longer supported in es profile; removed in version 300
      ERROR: xyz/bindingloops_qt6.vert:1: '' : compilation terminated
      ERROR: 4 compilation errors.  No code generated.
      

      We should simply add a new file wizard with the right GLSL style and point out in each description which Qt version it is compatible with.

      Attachments

        Issue Links

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

          Activity

            People

              cstenger Christian Stenger
              portale Alessandro Portale
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes