Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Shader compilation error : 'unsigned' reserved word

  1. #1
    Intern Contributor
    Join Date
    Oct 2010

    Shader compilation error : 'unsigned' reserved word


    I wrote a shader in version 110.
    I changed an uniform variable from int to unsigned int.
    I had no problem on my computer with nvidia card.
    But on another computer with ATI X1300/1550 I have the compilation error : 'unsigned' reserved word.

    I saw that "unsigned" is added since GLSL version 130.
    So I set #version 130 in my shader.
    But this changes nothing...

    It is funny that things that are not in the specifs work on nvidia.
    But it is not funny that things that may work do not work on ATI.
    With glewinfo I saw that using glUnifor1ui is possible on this ATI with opengl 3.0 (ie GLSL 130).

    Why does it not work on ATI ?
    Is my "#version 130" not enough ?

    I can use an int like now but I would like to understand...


  2. #2
    Member Regular Contributor Agent D's Avatar
    Join Date
    Sep 2011
    Innsbruck, Austria
    See here for GLSL data types. It is called "uint", not "unsigned int".
    Last edited by Agent D; 06-18-2014 at 05:52 AM. Reason: typo

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Jan 2007
    The general rule for desktop OpenGL is:

    • Things work on NVIDIA that shouldn't.
    • Things don't work on AMD that should.
    • Intel is a jungle.

    You really need to test on all 3 vendors and you can assume nothing. In many cases it comes down to a choice between writing 3 separate vendor-specific code paths or finding the minimum that works consistently on all 3. What a mess.

  4. #4
    Intern Contributor
    Join Date
    Oct 2010
    I used uint ; "unsigned" is in the error message.

    So bad news if this is not a beginner mistake with #version or something else...

    Thanks for your quick answers.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts