Showing results for 
Search instead for 
Did you mean: 

Compilation bug: unary - on unsigned literal

System Setup Information:

System Used: hp elitebook 840 g5
CPU SKU: Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
GPU SKU: UHD Graphics 620
Processor Line: N/A
System BIOS Version: N/A
CMOS settings: N/A
Graphics Driver Version:
GOP/VBIOS Version: N/A
Operating System: Windows 10 
OS Version: 1803 (10.0.17134)
API: opengl
Occurs on non-Intel GPUs?: not on nvidia

Steps to Reproduce:

This shader fail to compile:

"#version 430\n"
"uniform mat4 MVP;\n"
"attribute vec3 vCol;\n"
"attribute vec2 vPos;\n"
"varying vec3 color;\n"
"void main()\n"
"    gl_Position = MVP * vec4(vPos, 0.0, 1.0);\n"
"    uint a = 0u;\n"
"    uint b = -1u;\n"
"    uint c = a+b;\n"
"    color = vCol;\n"

The error message is: Error: ERROR: 0:10: '' : unary '-' not allowed for provided data type

Expected Results:

Not to fail


Actual Results:



Additional Information:

Sample project (self contained, based on the "simple" glfw test code): compile with vs2017x64 with "cl simple.c glad.c glfw3dll.lib opengl32.lib gdi32.lib user32.lib kernel32.lib"

0 Kudos
0 Replies