Opened 10 years ago

Last modified 3 years ago

#12126 new bug

A problem with lib GLEW

Reported by: Max-Might Owned by: kallisti5
Priority: normal Milestone: Unscheduled
Component: Kits/OpenGL Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

Hello. I am porting a program that uses lib glew to Haiku. I installed glew_x86 and glew_x86_util. The second package installs two executables - visualinfo_x86 and glewinfo_x86. They both fail to start - it seems like glewInit can not detect GL version?

~/stuff> visualinfo-x86 
Error [main]: glewInit failed: Missing GL version
~/stuff> glewinfo-x86 
Error [main]: glewInit failed: Missing GL version

I wonder if this is related to the mesa port or the problem is in libglew only. Looking at the libglew code it seems like glGetString(GL_VERSION) returns something that it does not recognize as a valid GL version. Can anyone help me investigate this issue?

Change History (4)

comment:1 by kallisti5, 10 years ago

Interesting... the GL_VERSION shouldn't of changed in any way to make it incompatible unless this version of glew is *really* old.

could you run the following?

pkgman search -D glew

The current recipe version is 1.12.0 https://bitbucket.org/haikuports/haikuports/history-node/8aeb2cfbf972/media-libs/glew/glew-1.12.0.recipe?at=master

comment:2 by Max-Might, 10 years ago

I had 1.11 installed, I just installed 1.12 from haikuports but the problem seems to persist.

I am using also the latest mesa_x86 with swpipe from haikuports:

~> pkgman search -D mesa
Repository  Name             Version   Arch    
-----------------------------------------------
<system>    mesa             7.9.2-10  x86_gcc2
HaikuPorts  mesa             7.9.2-10  x86_gcc2
<system>    mesa_devel       7.9.2-10  x86_gcc2
HaikuPorts  mesa_devel       7.9.2-10  x86_gcc2
HaikuPorts  mesa_source      7.9.2-10  source  
<system>    mesa_swrast      7.9.2-10  x86_gcc2
HaikuPorts  mesa_swrast      7.9.2-10  x86_gcc2
<system>    mesa_x86         10.5.2-1  x86_gcc2
HaikuPorts  mesa_x86         10.1.0-2  x86_gcc2
<system>    mesa_x86_devel   10.5.2-1  x86_gcc2
HaikuPorts  mesa_x86_devel   10.1.0-2  x86_gcc2
HaikuPorts  mesa_x86_source  10.1.0-2  source  
<system>    mesa_x86_swpipe  10.5.2-1  x86_gcc2
HaikuPorts  mesa_x86_swpipe  10.1.0-2  x86_gcc2
HaikuPorts  mesa_x86_swrast  10.1.0-2  x86_gcc2

I think the problem is not in glew but in glGetString(). #10206 also seems to be related to this problem. Do we have to implement something Haiku-specific in the swpipe driver for glGetString?

comment:3 by Max-Might, 10 years ago

So I ran the command again but this time with the mesa debug environment variable enabled.

~> MESA_DEBUG=1 glewinfo-x86 
GL User Error: calling GL function without a rendering context
Error [main]: glewInit failed: Missing GL version

Reading the HAiku patch in the ports tree is found that glewCreateContext returns GL_FALSE when it creates an instance of the application class. Do you think this causes the problem?

Version 0, edited 10 years ago by Max-Might (next)

comment:4 by cocobean, 3 years ago

Tested with Haiku hrev55507 x86-64. Updated glew 2.2.0.

-> visualinfo

OpenGL vendor string: Mesa/X.org
OpenGL renderer string: llvmpipe (LLVM 9.0.1, 128 bits)
OpenGL version string: 3.1 Mesa 21.2.3 (git-84288ed495)
OpenGL extensions (GL_): 
    GL_ARB_multisample, GL_EXT_abgr, GL_EXT_bgra, GL_EXT_blend_color,
    GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_copy_texture,
    GL_EXT_subtexture, GL_EXT_texture_object, GL_EXT_vertex_array,
    GL_EXT_compiled_vertex_array, GL_EXT_texture, GL_EXT_texture3D, ...
    GL_EXT_texture_shadow_lod, GL_EXT_EGL_sync.

-> MESA_GL_VERSION_OVERRIDE=4.6 visualinfo

OpenGL vendor string: Mesa/X.org
OpenGL renderer string: llvmpipe (LLVM 9.0.1, 128 bits)
OpenGL version string: 4.6 (Compatibility Profile) Mesa 21.2.3 (git-84288ed495)
OpenGL extensions (GL_): 
    GL_ARB_multisample, GL_EXT_abgr, GL_EXT_bgra, GL_EXT_blend_color,
    GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_copy_texture,
    GL_EXT_subtexture, GL_EXT_texture_object, GL_EXT_vertex_array,
    GL_EXT_compiled_vertex_array, GL_EXT_texture, GL_EXT_texture3D, ...
    GL_EXT_texture_shadow_lod, GL_MESA_framebuffer_flip_y, GL_EXT_EGL_sync.

-> glewinfo

---------------------------
    GLEW Extension Info
---------------------------

GLEW version 2.2.0
Running on a llvmpipe (LLVM 9.0.1, 128 bits) from Mesa/X.org
OpenGL version 3.1 Mesa 21.2.3 (git-84288ed495) is supported

GL_VERSION_1_1:                                                OK 
---------------

(etc, etc.....)

GL_VERSION_3_1:                                                OK 
---------------
  glDrawArraysInstanced:                                       OK
  glDrawElementsInstanced:                                     OK
  glPrimitiveRestartIndex:                                     OK
  glTexBuffer:                                                 OK

(etc.....etc)

-> MESA_GL_VERSION_OVERRIDE=4.6 glewinfo

---------------------------
    GLEW Extension Info
---------------------------

GLEW version 2.2.0
Running on a llvmpipe (LLVM 9.0.1, 128 bits) from Mesa/X.org
OpenGL version 4.6 (Compatibility Profile) Mesa 21.2.3 (git-84288ed495) is supported

(etc.... etc....)

GL_VERSION_3_1:                                                OK 
---------------
  glDrawArraysInstanced:                                       OK
  glDrawElementsInstanced:                                     OK
  glPrimitiveRestartIndex:                                     OK
  glTexBuffer:                                                 OK

GL_VERSION_3_2:                                                OK 
---------------
  glFramebufferTexture:                                        OK
  glGetBufferParameteri64v:                                    OK
  glGetInteger64i_v:                                           OK

GL_VERSION_3_3:                                                OK 
---------------
  glVertexAttribDivisor:                                       OK

GL_VERSION_4_0:                                                OK 
---------------
  glBlendEquationSeparatei:                                    OK
  glBlendEquationi:                                            OK
  glBlendFuncSeparatei:                                        OK
  glBlendFunci:                                                OK
  glMinSampleShading:                                          OK

GL_VERSION_4_1:                                                OK 
---------------

GL_VERSION_4_2:                                                OK 
---------------

GL_VERSION_4_3:                                                OK 
---------------

GL_VERSION_4_4:                                                OK 
---------------

GL_VERSION_4_5:                                                MISSING 
---------------

GL_VERSION_4_6:                                                MISSING 
---------------

Last edited 3 years ago by cocobean (previous) (diff)
Note: See TracTickets for help on using tickets.