1 Reply Latest reply on Nov 22, 2018 4:54 AM by dorisyan

    glteximage2d creates corrupted depth texture

    gbeatty

      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