Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Fragment shader seems to fail to compile but the problematic fragment shader code is not mine
Forum Update on Monday, May 27th 2025

Fragment shader seems to fail to compile but the problematic fragment shader code is not mine

Scheduled Pinned Locked Moved Unsolved General and Desktop
opengl
3 Posts 2 Posters 845 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    andyP
    wrote on 3 Mar 2022, 17:32 last edited by andyP 3 Apr 2022, 09:18
    #1

    The Qt opengl\cube example project works but it is output'ing the following message to DbgView:

    [1996] QOpenGLShader::compile(Fragment): ERROR: 4:1: 'textureSampler' : syntax error syntax error
    [1996] 
    [1996] 
    [1996] *** Problematic Fragment shader source code ***
    [1996] #version 110
    [1996] #ifdef GL_KHR_blend_equation_advanced
    [1996] #extension GL_ARB_fragment_coord_conventions : enable
    [1996] #extension GL_KHR_blend_equation_advanced : enable
    [1996] #endif
    [1996] #define lowp
    [1996] #define mediump
    [1996] #define highp
    [1996] #line 1
    [1996] varying highp vec2 uv;uniform sampler2DRect textureSampler;uniform bool swizzle;uniform highp float opacity;void main() {   highp vec4 tmpFragColor = texture2DRect(textureSampler,uv);   tmpFragColor.a *= opacity;   gl_FragColor = swizzle ? tmpFragColor.bgra : tmpFragColor;}
    [1996] ***
    

    I am using Qt 5.15.8. The platform is Windows 7.

    The computer is supposed to support OpenGL4.4:
    OpenGLExtension.PNG

    OpenGLExtension2.PNG

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 3 Mar 2022, 19:54 last edited by
      #2

      Hi,

      Which version of Qt are you using ?
      Do you have the same issue if you run Qt's OpenGL examples ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      A 1 Reply Last reply 4 Mar 2022, 08:40
      0
      • S SGaist
        3 Mar 2022, 19:54

        Hi,

        Which version of Qt are you using ?
        Do you have the same issue if you run Qt's OpenGL examples ?

        A Offline
        A Offline
        andyP
        wrote on 4 Mar 2022, 08:40 last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0

        1/3

        3 Mar 2022, 17:32

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved