Bug 77582 - [r600g] ogl-samples GL3.2 and GL3.3 tests doesn't run without overriding GL/GLSL version
Summary: [r600g] ogl-samples GL3.2 and GL3.3 tests doesn't run without overriding GL/G...
Status: RESOLVED INVALID
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/r600 (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-17 16:42 UTC by Benjamin Bellec
Modified: 2014-04-23 21:03 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Benjamin Bellec 2014-04-17 16:42:40 UTC
The OpenGL 3.2 and 3.3 tests from the ogl-samples pack doesn't run on my Evergreen card (HD 5850) if I don't override the env var with the good GL and GLSL values.

Download and compiles the ogl-samples:
$ git clone https://github.com/g-truc/ogl-samples
$ cmake .
$ make 
$ ./build/release/gl-320-primitive-sprite

In my case, the program starts but immediately stop, without error.

While if I launch with:
$ MESA_GL_VERSION_OVERRIDE=3.2 MESA_GLSL_VERSION_OVERRIDE=150 ./build/release/gl-320-primitive-sprite

Then the program start as excepted.

I tested several ogl-320 and ogl-330 tests, all have the same issue.

glxinfo:
OpenGL renderer string: Gallium 0.4 on AMD CYPRESS
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.2.0-devel (git-75e4875)
OpenGL core profile shading language version string: 3.30

Build config:
autogen.sh --with-gallium-drivers=r600 --with-dri-drivers= --enable-texture-float --disable-dri3 --disable-r600-llvm-compiler --disable-gallium-llvm --enable-64-bit CFLAGS="-O2 -m64" CXXFLAGS="-O2 -m64" --libdir=/usr/lib64

Kernel 3.13.9-100.fc19.x86_64
libdrm 2.4.53-1.fc20

I don't know if it's a regression. I can test with earlier Mesa commit if you point me to an old commit with still GL3.2 supports.
Comment 1 Michel Dänzer 2014-04-18 03:25:03 UTC
Mesa will probably never support higher than OpenGL 3.0 for the compatibility profile. Apps should use the core profile for higher versions.
Comment 2 Benjamin Bellec 2014-04-18 11:02:48 UTC
All these tests uses the core profile.
Comment 3 Timothy Arceri 2014-04-19 03:20:14 UTC
The error Mesa throws is: 

Mesa: User error: GL_INVALID_ENUM in glGetString(GL_EXTENSIONS)

The test shoudn't be calling glGetString(GL_EXTENSIONS) in a core profile you might want to report this in their bug tracker.
Comment 4 Timothy Arceri 2014-04-19 03:27:03 UTC
ok I reported it here: https://github.com/g-truc/ogl-samples/issues/34
Comment 5 Benjamin Bellec 2014-04-21 17:22:59 UTC
Thanks Timothy for reporting this one to upstream.
Comment 6 Benjamin Bellec 2014-04-21 18:37:45 UTC
FYI, I looked closely to the code.

The Mesa error came from ogl-samples file "framework/glew.c", line 9535 (extStart = glGetString(GL_EXTENSIONS);).

This GLEW file is the official glew.c version 1.10.0.

And I finally understood that there is two problems:

- current GLEW version doesn't check the GL version and always calls glGetString(). A patch was submitted more than 2 years but still need to be commited:
http://sourceforge.net/p/glew/bugs/174/

- GLEW currently doesn't supports core profile:
http://sourceforge.net/p/glew/bugs/209/
and
https://www.opengl.org/discussion_boards/showthread.php/169661-Forcing-Core-Profile-in-GLEW

So I guess ogl-samples should not use GLEW.
Comment 7 Benjamin Bellec 2014-04-23 21:03:30 UTC
Old libGL in /usr/local/lib64


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.