Thursday 26 June 2014

DirectX crashes inside the intel igd10iumd32.dll driver

Sometimes, a DX11 pixel shader that does nothing but "discard", causes mystery access violations deep inside igd10iumd32.dll. So watch out for that.

Monday 16 June 2014

Uniform buffers in OpenGL

In OpenGL, the uniform buffer "Binding Index" is the equivalent of DX11's buffer slots. However, GL has many, many more indices available for than DX - about 35000.

You should therefore NEVER use the same index to bind two different blocks in the same frame - there's simply no need.

e.g


 static int lastBindingIndex=21;
 if(lastBindingIndex>=GL_MAX_UNIFORM_BUFFER_BINDINGS)
  lastBindingIndex=1;
 bindingIndex=lastBindingIndex;
 lastBindingIndex++;
 
 glUniformBlockBinding(program,indexInShader,bindingIndex);