AnsweredAssumed Answered

calling glLinkProgram crashes

Question asked by einzuweitesfeld on Feb 18, 2017
Latest reply on Mar 16, 2017 by dwitczak

When linking a program that consists of a FS from the following code the call to glLinkProgram crashes with a NULL pointer exception:


#version 450


uniform int umsch;//umschalten

layout(binding = 0) uniform sampler2D FarbTextur;


                       in  vec2 ausgTexKoord;

layout(location = 0)   out vec4 Helligkeit;


void main( void ){

  float test_ft;

  float asdf;


  do {

    if( ausgTexKoord.x < 0.0f || ausgTexKoord.y < 0.0f )

      test_ft = 1.0;

  } while(false);


  if(umsch == 1){

    test_ft = asdf;



  Helligkeit = vec4(test_ft);

  test_ft = texture( FarbTextur, ausgTexKoord ).x;



The code looks pretty random and that's because it is. I have tried to remove as much from it while still triggering the exception and that's what I end up with.

Note that both, the VS and the FS compile without problems and I check that by calling glGetShaderiv with the GL_COMPILE_STATUS argument. Also attaching the compiled Shaders to the program works fine. But when I call glLinkProgram on said program the (C++) application crashes with a NULL pointer exception.


I have tested on an RX 480 with the latest drivers. It says Driver Packaging Version is 16.50.2011-161223a-310015C and OpenGL Driver version and my OS is Windows 7 64 bit.

I have attached a zip file with a Visual C++ 2010 project and the following relevant files:

  • Quelle1.cpp
  • Shader/test.frag
  • Shader/test.vert

Can someone confirm this behaviour?