I get a strange OpenGL error when running my application on my HD4000 (Windows 64bit, driver version 15.28.20.64.3347).
I welded it to several OpenGL calls to reproduce it:
- Create two framebuffer objects.
- Create a texture and bind it as GL_COLOR_ATTACHMENT0 to both FBOs.
- Call glTexImage2D a second time on a texture
- Bind the first FBO and call glCheckFramebufferStatus (returns GL_FRAMEBUFFER_COMPLETE).
- Bind a second FBO and call glClear. GlClear gives GL_INVALID_FRAMEBUFFER_OPERATION.
Steps 3 and 4 are necessary to reproduce the error, which I find particularly alarming for calling glCheckFramebufferStatus. The problem also does not occur on other video cards (including the Nvidia card on the same computer).
If you call glCheckFramebufferStatus in the second FBO, it also returns GL_FRAMEBUFFER_COMPLETE. However, when checking the internal state of OpenGL with apitrace, he says that the second FBO now has a color binding with a null object name.
Rebinding the texture to the second FBO after calling glCheckFramebufferStatus resolves the error. This currently works as a workaround, but I believe linking textures with different FBOs in each frame is not a good idea.
Here is the C ++ code that reproduces the error:
Here is a minimal Visual Studio 2013 project to reproduce it: https://www.dropbox.com/s/5142j26d839gkp9/HD4000Error.zip
Now, my question is: am I doing something illegal with OpenGL here or is it just a driver error?
source share