cancel
Showing results for 
Search instead for 
Did you mean: 

OpenGL & Vulkan

gbeatty
Journeyman III

glteximage2d creates corrupted depth texture

With the latest drivers (18.11.2) and at least the previous driver I'm getting corrupted depth textures when I attempt to create depth textures that have a dimensions smaller than 512px.

glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT24, 200, 200, GL_DEPTH_COMPONENT, GL_FLOAT, nullptr)

The above command completes without any errors. However, any attempt to render to this texture via FBO results in garbage data being written to the texture. If I immediately follow the glteximage2d() call with a call to glTexSubImage2D() with some initialization data then the texture becomes valid, and works as expected.

There are 2 other ways that also cause the creation of a valid (uncorrupted) texture without the need to call glTexSubImage2D().

1. If either width or height in the glTexImage2D() is greater than 512px

2. use an internal format that includes stencil components (ie GL_DEPTH24_STENCIL8)

Anyone have any ideas? This sure seems like a driver bug to me. FYI this same code works without any problems on various Nvidia cards that we use around our shop.

Edit:

This is being used in a legacy application that requires the use of an OpenGL compatibility context

0 Likes
1 Reply
dorisyan
Staff

hi, gbeatty​, if you could provide the minimum code to reproduce the problem, that'll be very helpful for us to investigate this issue effectively. Thanks.

0 Likes