0

I’m trying to make a visualization in PyQt. I inherited QGLWidget and reimplemented initializeGL(), resizeGL(), paintGL(). Program and shaders are compiled in initializeGL(). Everything worked fine until I have installed latest driver for my Intel HD graphics 4600. Now - ver. 10.18.14.4170, date 16.03.2015, before - ver. 9.18.10.3204, date 03.06.2013. Now I get the following:

Traceback (most recent call last):
  ….
    vert_shader = shaders.compileShader(v_grid_3_3, GL_VERTEX_SHADER)
  File "C:\...\WinPython-64bit-2.7.6.2\python-2.7.6.amd64\lib\site-packages\OpenGL\GL\shaders.py", line 218, in compileShader
    shader = glCreateShader(shaderType)
  File "C:\...\WinPython-64bit-2.7.6.2\python-2.7.6.amd64\lib\site-packages\OpenGL\latebind.py", line 45, in __call__
    return self._finalCall( *args, **named )
WindowsError: exception: access violation writing 0xFFFFFFFFE84BD7F0

Also I’ve downloaded demo from https://pypi.python.org/pypi/PyOpenGL-Demo and tried to run PyOpenGL-Demo-3.0.1b1\PyOpenGL-Demo\GLUT\shader_test.py – same error.

Does anyone know how to solve this problem?

I checked some parameters with glGet*(*):

# After update -  ver. 10.18.14.4170, date  16.03.2015
VENDORE: Intel
RENDERER: Intel(R) HD Graphics 4600
GL VERSION: 4.3.0 - Build 10.18.14.4170
GLSL VERSION: 4.30 - Build 10.18.14.4170

GL_MAX_TEXTURE_SIZE         : 16384
GL_MAX_3D_TEXTURE_SIZE      : 2048
GL_MAX_VERTEX_ATTRIBS       : 16
GL_MAX_TEXTURE_BUFFER_SIZE  : 134217728
GL_MAX_CUBE_MAP_TEXTURE_SIZE: 16384
GL_MAX_VARYING_FLOATS       : 64
GL_MAX_TEXTURE_UNITS        : 8
GL_MAX_DRAW_BUFFERS         : 8


# Before update -  ver. 9.18.10.3204, date 03.06.2013
VENDORE: Intel
RENDERER: Intel(R) HD Graphics 4600
GL VERSION: 4.0.0 - Build 9.18.10.3204
GLSL VERSION: 4.00 - Build 9.18.10.3204

GL_MAX_TEXTURE_SIZE         : 8192
GL_MAX_3D_TEXTURE_SIZE      : 2048
GL_MAX_VERTEX_ATTRIBS       : 16
GL_MAX_TEXTURE_BUFFER_SIZE  : 4194304
GL_MAX_CUBE_MAP_TEXTURE_SIZE: 8192
GL_MAX_VARYING_FLOATS       : 64
GL_MAX_TEXTURE_UNITS        : 8
GL_MAX_DRAW_BUFFERS         : 8

I've printed GL_VERTEX_SHADER, GL_FRAGMENT_SHADER and got GL_VERTEX_SHADER (0x8B31) GL_FRAGMENT_SHADER (0x8B30). Also I've tried to get glGetError() after glCreateShader() in shader_test.py (mentioned before),but got

Hit ESC key to quit.
    Traceback (most recent call last):
      File "C:/.../PyOpenGL-Demo-3.0.1b1/PyOpenGL-Demo/GLUT/shader_test.py", line 162, in <module>
        main()
      File "C:/.../PyOpenGL-Demo-3.0.1b1/PyOpenGL-Demo/GLUT/shader_test.py", line 153, in main
        InitGL(640, 480)
      File "C:/.../PyOpenGL-Demo-3.0.1b1/PyOpenGL-Demo/GLUT/shader_test.py", line 42, in InitGL
        s = glCreateShader(GL_VERTEX_SHADER)
      File "C:\...\WinPython-64bit-2.7.6.2\python-2.7.6.amd64\lib\site-packages\OpenGL\latebind.py", line 45, in __call__
        return self._finalCall( *args, **named )
    WindowsError: exception: access violation writing 0xFFFFFFFFEB3DCBD0


Process finished with exit code 1

so it finished before glGetError() was called. If I place it before glCreateShader(), after another gl*() it returns 0

Solved: It turned out that problem was in old PyOpenGL 3.0.2 (2012-10-02). Problem gone after PyOpenGL-3.1.1a1 (2015-02-13) was installed.

Marsel
  • 9
  • 4
  • if `glCreateShader()` fails shader should be 0. Check that. If it's `GL_INVALID_ENUM ` your shaderType was refused. Consider calling `glGetError()` [man](https://www.opengl.org/sdk/docs/man/docbook4/xhtml/glGetError.xml) – xuma202 Apr 23 '15 at 12:25
  • I don't understand what do you mean by "shader should be 0". I've printed GL_VERTEX_SHADER, GL_FRAGMENT_SHADER and got GL_VERTEX_SHADER (0x8B31) GL_FRAGMENT_SHADER (0x8B30). – Marsel Apr 24 '15 at 05:12
  • The return value of glCreateShader is supposed to be zero if the function fails or it isGL_INVALID_ENUM if your parameter is wrong. – xuma202 Apr 24 '15 at 05:15
  • Unfortunately I can't check return value because it throws exception before in '...\OpenGL\latebind.py'. It returned 1 when everything worked (with old driver). Probably it's pyopengl or driver error, because there was no error before. – Marsel Apr 24 '15 at 05:33
  • Yes it totally seems the bug is within the python header/binding. Your code seems fine.unfortunately you can not do much about it other than report the bug to those writing the python opengl library or trace down the bug by yourself if their code is open source – xuma202 Apr 24 '15 at 05:46

1 Answers1

0

It turned out that problem was in old PyOpenGL 3.0.2 (2012-10-02). Problem gone after PyOpenGL-3.1.1a1 (2015-02-13) was installed.

Marsel
  • 9
  • 4