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

[Bug Report] GLSL compiler crashes when glsl code ends with # endif

idata
Employee
1,219 Views

Renderer info:

GL_VENDOR:Intel

 

GL_RENDERER:Intel(R) HD Graphics 3000

 

GL_VERSION:3.1.0 - Build 8.15.10.2696

Description:

Code crashes somewhere in glCompileShader. Any whitespace characters after # endif prevents crash.

Code:

 

std::string shader_src =

 

"# ifdef DEFINED\r\n"

 

"out vec4 position;\r\n"

 

"void main() {position = vec4(1.0,1.0,1.0,1.0);} \r\n"

 

"# else\r\n"

 

"out vec4 position;\r\n"

 

"void main() {position = vec4(1.0,1.0,1.0,1.0);} \r\n"

 

"# endif";

 

std::string head = "# version 130\r\n# define DEFINED 1\r\n";

 

 

gl::GLint shader = gl::glCreateShader(gl::GL_VERTEX_SHADER);

 

 

const char* sources[] = {head.c_str(), shader_src.c_str()};

 

gl::GLint lens[] = {head.size(),shader_src.size()};

 

 

gl::glShaderSource(shader,2,sources,lens);

 

gl::glCompileShader(shader);

 

0 Kudos
2 Replies
Allan_J_Intel1
Employee
413 Views

Hi there!

The Intel engineering department is aware of this problem and they are currently working on it. Please keep checking this post for future updates.

Thanks

Allan.

0 Kudos
Reply