Closed ianromanick closed 2 years ago
Looking at this after the meeting, I'm wondering if glTexImage2D(..., internalformat=STENCIL_INDEX, ..., format=DEPTH_STENCIL, ...)
should be allowed.
By the existing error, quoted above, it is not. However, glTexImage2D(..., internalformat=DEPTH_COMPONENT, ..., format=DEPTH_STENCIL, ...)
does seem to be valid. Is that intended? Ugh!
Our implementation supports this:
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT24, 8, 8, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8_EXT, data);
but does not support this:
glTexImage2D(GL_TEXTURE_2D, 0, GL_STENCIL_INDEX8, 8, 8, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8_EXT, data);
The first does seem to be explicitly allowed by the spec, and the second throws INVALID_OPERATION. I think your proposed spec fix to clarify the error for STENCIL_INDEX and not DEPTH_STENCIL is good.
@oddhack can you change the error on page 215 of the OpenGL 4.6 core spec from:
An INVALID_OPERATION error is generated if format is STENCIL_INDEX and the base internal format is not STENCIL_INDEX.
to
An INVALID_OPERATION error is generated if either base internal format or format is STENCIL_INDEX and the other is not also STENCIL_INDEX.
This should be fixed in the spec update of May 5, 2022.
The "Errors" block at the end of section 8.5.3 (Texture Image Structure) of the OpenGL 4.6 spec says:
I think the
STENCIL_INDEX
error should have the same conditions as theDEPTH_COMPONENT
/DEPTH_STENCIL
case.The spec is clear that
glTexImage2D(..., internalformat=RGBA8, ..., format=GL_STENCIL_INDEX, ...)
is an error. I believeglTexImage2D(..., internalformat=GL_STENCIL_INDEX8, ..., format=GL_RGBA, ...)
should also generateGL_INVALID_OPERATION
.I propose changing the second error to be:
I think the "either ... or ..." wording is more readable, but language more similar to the previous line would also work.