diff --git a/doc/opengl-support.dox b/doc/opengl-support.dox index 9296e5e4c..0a0d08b8c 100644 --- a/doc/opengl-support.dox +++ b/doc/opengl-support.dox @@ -392,7 +392,7 @@ Extension | Status @es_extension{OES,sample_variables} | done (shading language only) @es_extension{OES,shader_image_atomic} | done (shading language only) @es_extension{OES,shader_multisample_interpolation} | | -@es_extension{OES,texture_stencil8} | | +@es_extension{OES,texture_stencil8} | done @es_extension{OES,texture_storage_multisample_2d_array} | done @subsection opengl-support-webgl10 WebGL 1.0 diff --git a/src/Magnum/AbstractTexture.cpp b/src/Magnum/AbstractTexture.cpp index 849865d55..f4441e55f 100644 --- a/src/Magnum/AbstractTexture.cpp +++ b/src/Magnum/AbstractTexture.cpp @@ -643,7 +643,7 @@ ColorFormat AbstractTexture::imageFormatForInternalFormat(const TextureFormat in #endif return ColorFormat::DepthComponent; - #ifndef MAGNUM_TARGET_GLES + #ifndef MAGNUM_TARGET_WEBGL case TextureFormat::StencilIndex8: return ColorFormat::StencilIndex; #endif @@ -840,7 +840,7 @@ ColorType AbstractTexture::imageTypeForInternalFormat(const TextureFormat intern return ColorType::Float; #endif - #ifndef MAGNUM_TARGET_GLES + #ifndef MAGNUM_TARGET_WEBGL case TextureFormat::StencilIndex8: return ColorType::UnsignedByte; #endif diff --git a/src/Magnum/ColorFormat.h b/src/Magnum/ColorFormat.h index d91aeafea..509147a32 100644 --- a/src/Magnum/ColorFormat.h +++ b/src/Magnum/ColorFormat.h @@ -265,13 +265,14 @@ enum class ColorFormat: GLenum { * data, otherwise for framebuffer reading only. * @requires_es_extension Extension @es_extension2{NV,read_stencil,GL_NV_read_depth_stencil}, * for framebuffer reading only. + * @requires_es_extension Extension @es_extension{ANDROID,extension_pack_es31a}/ + * @es_extension{OES,texture_stencil8}, for texture data only. * @requires_gles Stencil index is not available in WebGL. - * @todo Where to get GL_STENCIL_INDEX in ES? */ #ifndef MAGNUM_TARGET_GLES StencilIndex = GL_STENCIL_INDEX, #else - StencilIndex = 0x1901, + StencilIndex = GL_STENCIL_INDEX_OES, #endif #endif diff --git a/src/Magnum/TextureFormat.h b/src/Magnum/TextureFormat.h index 0b847979d..d604a9a2d 100644 --- a/src/Magnum/TextureFormat.h +++ b/src/Magnum/TextureFormat.h @@ -998,12 +998,13 @@ enum class TextureFormat: GLenum { DepthComponent32F = GL_DEPTH_COMPONENT32F, #endif - #ifndef MAGNUM_TARGET_GLES + #ifndef MAGNUM_TARGET_WEBGL /** * Stencil index, 8bit. Not supported in 3D textures. * @requires_gl44 Extension @extension{ARB,texture_stencil8} - * @requires_gl Only available as renderbuffer format in OpenGL ES and - * WebGL. + * @requires_es_extension Extension @es_extension{ANDROID,extension_pack_es31a}/ + * @es_extension{OES,texture_stencil8} + * @requires_gles Only available as renderbuffer format in WebGL. */ StencilIndex8 = GL_STENCIL_INDEX8, #endif