GLSL: unsigned integer constant overflow

Discussion created by cameni on Feb 9, 2010
Latest reply on Feb 22, 2010 by pboudier


driver version 10.1, the following line of GLSL code:

   uint k = 3367900313U;

gives me Syntax error ERROR___INTEGER_CONST_OVERFLOW, even though the unsigned constant is within 32 bits. Seems like the GLSL compiler rejects unsigned constants with the highest bit set, as if they were signed.
Writing it as

   uint k = 0xC8BE1499U;

works OK.