Hello all,
I am writing a simple 3D application using OpenGL, and I believe I have run across a bug in the ATI fglrx drivers. When binding a cubemap to a framebuffer object using glFramebufferTexture, I am unable to properly use a depth map with the gl_Layer functionality in the geometry shader.
I render my scene in one drawcall to my framebuffer object, with different cubemap textures on the color attachment points and on the depth attachment point. The color buffers work correctly, and I can duplicate vertices for each side and they redirect to the correct "layer" as I specify. The depth buffer, however, seems to always render on the +X side (#0). Consequently, rendering a single side, or multiple sides with the same gs output for each, will work fine - when I start independently transforming each side's vertices, though, I get all kinds of nasty output as they "fight" over the depth buffer.
When I render without the geometry shader, with a draw call for each side and manually binding each cube side with glFramebufferTexture2D, it works fine. Rendering with GS also works fine if depth test is disabled, but then I have to get into depth-sorting/etc.
When rendering with GS, I can show the "unwrapped" cube on-screen and confirm that the depth buffer only contains data in +X. I can also see that the unwrapped cube renders all correctly with depth testing disabled. I have run my program through a GL debugger, and have seen that no errors are generated.
Have I found a bug in the driver, or am I simply doing something wrong? Is there some part of the specification I missed, pertaining to layered framebuffer objects and depth buffers? I searched around a bit, but found no mention of this bug on google or on the "unofficial ati bug tracker." I'm sorry if this isn't quite the right place to ask, but I don't want to start filing bugs if I'm just missing something about GL. I've heard some crazy rumors that ATI people read this forum.
(Ubuntu 9.10 / updated drivers with ...9-12-x86.x86_64.run -> deb packages. fglrxinfo says GL version 3.2.9232. I can upload screenshots or more info if needed.)
I am writing a simple 3D application using OpenGL, and I believe I have run across a bug in the ATI fglrx drivers. When binding a cubemap to a framebuffer object using glFramebufferTexture, I am unable to properly use a depth map with the gl_Layer functionality in the geometry shader.
I render my scene in one drawcall to my framebuffer object, with different cubemap textures on the color attachment points and on the depth attachment point. The color buffers work correctly, and I can duplicate vertices for each side and they redirect to the correct "layer" as I specify. The depth buffer, however, seems to always render on the +X side (#0). Consequently, rendering a single side, or multiple sides with the same gs output for each, will work fine - when I start independently transforming each side's vertices, though, I get all kinds of nasty output as they "fight" over the depth buffer.
When I render without the geometry shader, with a draw call for each side and manually binding each cube side with glFramebufferTexture2D, it works fine. Rendering with GS also works fine if depth test is disabled, but then I have to get into depth-sorting/etc.
When rendering with GS, I can show the "unwrapped" cube on-screen and confirm that the depth buffer only contains data in +X. I can also see that the unwrapped cube renders all correctly with depth testing disabled. I have run my program through a GL debugger, and have seen that no errors are generated.
Have I found a bug in the driver, or am I simply doing something wrong? Is there some part of the specification I missed, pertaining to layered framebuffer objects and depth buffers? I searched around a bit, but found no mention of this bug on google or on the "unofficial ati bug tracker." I'm sorry if this isn't quite the right place to ask, but I don't want to start filing bugs if I'm just missing something about GL. I've heard some crazy rumors that ATI people read this forum.
(Ubuntu 9.10 / updated drivers with ...9-12-x86.x86_64.run -> deb packages. fglrxinfo says GL version 3.2.9232. I can upload screenshots or more info if needed.)
Comment