Graphics
Intel® graphics drivers and software, compatibility, troubleshooting, performance, and optimization
20943 Discussions

GLSL: "restrict" keyword wrongly leads to syntax error

Gerasimov_M_
Beginner
1,602 Views

Example:

uniform writeonly image2D restrict dest;

Result:

SHADER_ID_COMPILE error has been generated. GLSL compile failed for shader 2, "/$$rp/rpplugins/scattering/shader/eric_bruneton/transmittance.compute.glsl": ERROR: 0:34: 'restrict' : syntax error syntax error

Since "restrict" is valid keyword, there's no problem should be.

Windows 10, Intel HD 4600, latest drivers.

0 Kudos
2 Replies
Michael_C_Intel2
Employee
1,602 Views

Hi Gerasimov,

Can you fill in the template below, this looks like it could be a driver problem. But I need more information, including reproduction  steps and a sample if you have one so I can investigate. 

Thanks,

-Michael

 

System Setup Information:
-----------------------------------------

System Used: (Manufacturer/Model)
CPU SKU: (i3, i5, Pentium, Celeron, etc.)
GPU SKU: (HD4400, HD5100, etc.)
Processor Line: (Y-Series, U-Series, etc.)
System BIOS Version:
CMOS settings:
Graphics Driver Version:
GOP/VBIOS Version:
Operating System:
OS Version:
API:
Occurs on non-Intel GPUs?:

Steps to Reproduce:
-------------------------------
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.

Expected Results:
-------------------------------

Actual Results:
-------------------------------

Additional Information:
-------------------------------

0 Kudos
Gerasimov_M_
Beginner
1,602 Views

Hello! I faced problem while trying to run RenderPipeline project for Panda3D game engine.

Line "uniform writeonly image2D restrict dest;" is just part of GLSL-compute shader, it leads to syntax error. Here's shader source code. I think you can reproduce issue just running any shader containing this line on Intel HD graphics.

Currently both problems have solutions:

  • "restrict" should be placed before type - "uniform writeonly restrict image2D dest;"
  • "layout(rgba16f)" should be placed before "uniform" - "layout(rgba16f) uniform image3D dest;"

You can read discussion here.

So, I don't know if it's actually a bug, but keywords order doesn't matter for NVIDIA GPU's, so shader written for it would work on it and fail on Intel HD.

 

System Setup Information:
-----------------------------------------

System Used: ASUS Z87-K
CPU SKU: i5-4440
GPU SKU: HD4600
Processor Line: Haswell
System BIOS Version: Ametican Megatrends Inc. 1103 01/02/2014
Graphics Driver Version: 20.19.15.4380
Operating System: Windows 10 x64
Occurs on non-Intel GPUs?: No, on NVIDIA cards given snippets wouldn't lead to problem.

Steps to Reproduce:
-------------------------------

Just execute some compute shader that contain "uniform writeonly image2D restrict dest;"

Expected Results:
-------------------------------

No errors.

Actual Results:
-------------------------------

Syntax error.

0 Kudos
Reply