On 05/16/2014 12:05 AM, Ian Mallett wrote:

A user has reported an invalid operation OpenGL error from calling glUseProgramObjectARB. The important part of the trace:
  File "/home/sigurd/Documents/Test/5.00/shader.py", line 119, in use
  File "/usr/lib/python2.7/dist-packages/OpenGL/platform/baseplatform.py", line 379, in __call__
    return self( *args, **named )
  File "/usr/lib/python2.7/dist-packages/OpenGL/error.py", line 208, in glCheckError
    baseOperation = baseOperation,
GLError: GLError(
    err = 1282,
    description = 'invalid operation',
    baseOperation = glUseProgramObjectARB,
    cArguments = (2L,)

The exact source can be obtained by downloading the program from my website (here). The program creates the shader after an OpenGL context has been created, and in any case works on all the computers I have tested it on.

The user reports Python 2.7, PyGame 1.9.1, and PyOpenGL 3.1.0b2 running on Ubuntu 14.04 (x86-64). The GPU is an Intel Haswell Mobile.

I upgraded my PyOpenGL to the same version, but was unable to reproduce the problem myself (NVIDIA GeForce GTX 580M).

I can reproduce it here on a Kubuntu 14.04 laptop.  The shaderInfoLog on Intel driver may not be generated (compilation may not actually occur) until use-time (some drivers do not actually compile until use of the shader occurs).  You're seeing a failure to compile and that's causing this message to be generated:

    ['0:2(42): error: syntax error, unexpected IDENTIFIER, expecting EOL\n', 'error: linking with uncompiled shader']

where the linking with uncompiled shader is the proximate failure, while the previous one is the provoking failure. I just added a try/except around the call and called glGetShaderInfoLog for all of the program and shader ids.

Hope that helps,
  Mike C. Fletcher
  Designer, VR Plumber, Coder