Side-effects of calling glUseProgram()

Started by tindzk, March 26, 2016, 08:41:01

Previous topic - Next topic

tindzk

I am writing a video player. The actual rendering is performed by an actor that uses shaders for the YUV-to-RGB conversion. The video renders fine, but when I add additional actors for OSD labels, these are never shown. However, when I disable the video actor, the OSD labels are shown correctly.

I was able to reproduce the problem by reducing the code of the video rendering actor to:

glUseProgram(shader.program);
glUseProgram(0);


The shaders are initialised as follows: https://gist.github.com/tindzk/edc5b1167e894c8ec50f

Why is it that merely calling glUseProgram() has such side-effects on other actors?

Edit: The problem is most likely not related to my shaders as it also occurs when I use an entirely empty program:

glUseProgram(glCreateProgram());
glUseProgram(0);