Bug 93437 - [IVB] GLSL compiler doesn't recognize uniform layout format
Summary: [IVB] GLSL compiler doesn't recognize uniform layout format
Status: RESOLVED NOTABUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Ian Romanick
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-18 13:26 UTC by Deve
Modified: 2015-12-18 17:53 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Deve 2015-12-18 13:26:49 UTC
The ARB_compute_shader extension has been added recently for ivybridge and newer graphics cards (commit d04612b60d98ff785646affaffc3d7243deecb74).

But during compilation a shader, it fails on this line:

uniform layout(r16f) volatile restrict writeonly image2D dest;

The format r16f (and also other formats) are not recognized. 

The log from console:

[info   ] shader: Compiling shader : bilateralH.comp
[error  ] GLWrap: Error in shader bilateralH.comp
[error  ] GLWrap: 0:78(16): error: unrecognized layout identifier `r16f'

[error  ] GLWrapp: Error when linking these shaders :
[error  ] shader: bilateralH.comp
[error  ] GLWrapp: error: linking with uncompiled shader

These formats are handled in glsl_parser.cpp:

      if (state->ARB_shader_image_load_store_enable ||
          state->is_version(420, 310)) {

(...)
            } map[] = {
               { "rgba32f", GL_RGBA32F, GLSL_TYPE_FLOAT, 130, 310 },
               { "rgba16f", GL_RGBA16F, GLSL_TYPE_FLOAT, 130, 310 },
               { "rg32f", GL_RG32F, GLSL_TYPE_FLOAT, 130, 0 },
               { "rg16f", GL_RG16F, GLSL_TYPE_FLOAT, 130, 0 },
               { "r11f_g11f_b10f", GL_R11F_G11F_B10F, GLSL_TYPE_FLOAT, 130, 0 },

But it looks like state->ARB_shader_image_load_store_enable is never true.

Based on GL3.txt document, the ARB_shader_image_load_store extension is done for intel graphics cards. Also glew library reports us that this extension is available, so it looks that it should work.

It can be reproduced with Supertuxkart 0.9.1 or current git with enabled ambient occlusion in options.
Comment 1 Ian Romanick 2015-12-18 15:50:27 UTC
ARB_shader_image_load_store_enable, like all the *_enable flags, is supposed to be set when the appropriate #extension line is encountered.  Does the shader enable GL_ARB_shader_image_load_store?
Comment 2 Deve 2015-12-18 17:53:22 UTC
Okay, I missed the fact that intel drivers report only OpenGL 3.3, and these extensions need to be enabled manually. When I enabled GL_ARB_shader_image_load_store, GL_ARB_compute_shader and GL_ARB_arrays_of_arrays in the shader, it works fine now. I will try to handle it properly in STK.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.