Hey All!
I dug through specs and books today and I cannot figure this out.
What internal format combinations would work for this following code example, if my intention is to have raw storage allocated as a non compressed texture and the texture view interpreting this as BC5 / RGTC ?
GLuint texId;
glGenTextures(1, &texId);
glBindTexture(GL_TEXTURE_3D, texId);
glTexStorage3D(GL_TEXTURE_3D, 1, GL_RGBA32UI, 4, 4, 16);
glBindTexture(GL_TEXTURE_3D, 0);
assertNoError();
GLuint viewId;
glGenTextures(1, &viewId);
glTextureView(viewId, GL_TEXTURE_3D, texId, GL_COMPRESSED_RG_RGTC2, 0, 1, 0, 1);
assertNoError();
glDeleteTextures(1, &viewId);
glDeleteTextures(1, &texId);
assertNoError();
This example failed with INVALID_OPERATION and the GL debug output message says:
Internal formats neither compatible nor identical.
To narrow my question by exclusion:
- glCompressed* with pixel unpack buffer is not an option.
- TexStorage cannot have the compressed internal format. This is GL 4.5 and that has been removed.
- OpenGL spec says this following pair is compatible: GL_RGTC2_RG, GL_COMPRESSED_RG_RGTC2. However GL_RGTC2_RG is not a GL define or defined value in any header or the spec.
It is my understanding according to the compatibility table that the code as written won’t work.
Is this a contradiction? I can not create a compressed texture with immutable storage as it seems. But the view demands that it is both and lists compressed textures.
Is there any way to make this work?
Context is that I am writing to it with CUDA/GL interop, which cannot work with compressed formats. host side calls are also not an option.
Would really appreciate some help here.
Cheers,
Florian