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

shadertools: Binding qualifiers for samplers in GLSL output breaks some 3.2 - 4.1 core profile systems

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 5.14, 5.15
    • Qt RHI, Quick: SceneGraph
    • None
    • ff102f01ed25b80abb770c6c6ef82d877dd508a3 (qt-labs/qtshadertools/master)

    Description

      The core-compatible versions of the generated GLSL code contain binding qualifiers for samplers, which is only safe when GL_ARB_shading_language_420pack is supported.

      #version 150
      #ifdef GL_ARB_shading_language_420pack
      #extension GL_ARB_shading_language_420pack : require
      #endif
      #ifdef GL_ARB_separate_shader_objects
      #extension GL_ARB_separate_shader_objects : require
      #endif
      
      layout(binding = 1) uniform sampler2D qt_Texture;
      

      For example, the OpenGL on macOS does not have this extension, so using a 4.1 core profile context leads to failing GLSL shader compilation. (using 2.1 would work since the 120 shader has no 'layout' in the first place)

      For uniform blocks the same problem is not applicable, because we always enable SPVC_COMPILER_OPTION_GLSL_EMIT_UNIFORM_BUFFER_AS_PLAIN_UNIFORMS.

      So perhaps we should also disable SPVC_COMPILER_OPTION_GLSL_ENABLE_420PACK_EXTENSION.

      Attachments

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

        Activity

          People

            lagocs Laszlo Agocs
            lagocs Laszlo Agocs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes