I am working on an application which requires bit-casting some texture formats to others. One of these reinterpretations is DEPTH24_STENCIL8 to RGBA8. I implemented the reinterpretation by creating a texture view of the DEPTH24_STENCIL8 texture and setting GL_DEPTH_STENCIL_TEXTURE_MODE to GL_STENCIL_INDEX for the view. Then I sample both the depth texture and the stencil view in a shader that performs the reinterpretation.
glTextureViewOES(stencil, GL_TEXTURE_2D, depth, GL_DEPTH24_STENCIL8, 0, 1, 0, 1); glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, stencil); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_DEPTH_STENCIL_TEXTURE_MODE, GL_STENCIL_INDEX);
According to the texture view specification this should be supported as long as I'm not making a view of a different format from the depth/stencil texture.
https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_texture_view.txt
However, the driver spits out this message:
API ERROR 2147483647: incompatible view classes
And the stencil view is not sampled.
Is this a driver bug, or am I doing something wrong?