Forums - glTextureViewOES on DEPTH24_STENCIL8

1 post / 0 new
glTextureViewOES on DEPTH24_STENCIL8
mohror64
Join Date: 29 Mar 20
Posts: 1
Posted: Tue, 2020-04-07 13:06

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?

  • Up0
  • Down0

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.