[Mesa-dev] GL_DEPTH_STENCIL_TEXTURE_MODE and filter type
Józef Kucia
joseph.kucia at gmail.com
Sun Dec 4 14:24:55 UTC 2016
Hello,
Sampling the stencil value in Mesa seems to work only with NEAREST filter
type. This seems to be consistent with the following excerpt from the GL
spec:
"In order to access the stencil index texture component the
DEPTH_STENCIL_TEXTURE_MODE texture parameter should be set to STENCIL_INDEX
. When this mode is set the depth component is ignored and the texture
value includes only the stencil index component. The stencil index value is
treated as an unsigned integer texture and returns an unsigned integer
value when sampled. When sampling the stencil index only NEAREST filtering
is supported. The DEPTH_STENCIL_TEXTURE_MODE is ignored for non
depth/stencil textures.".
On the other hand, I think it would make sense to allow the same filter
types as for integer samplers. The Nvidia blob seems to allow the usage of
NEAREST_MIPMAP_NEAREST for stencil texturing. Moreover, there is the
following item in the GL 4.5 spec changelog:
"Add NEAREST_MIPMAP_NEAREST to the allowed filter modes for STENCIL_INDEX
textures in
section 8.17 (Bug 12791).".
The section 8.17 says that is said to be complete when "The internal format
is DEPTH_STENCIL and the value of DEPTH_STENCIL_TEXTURE_MODE for the
texture is STENCIL_INDEX" and the minification filter is NEAREST or
NEAREST_MIPMAP_NEAREST.
I don't have access to the bug 12791 so I cannot say what it is about
exactly, but was its intention to allow NEAREST_MIPMAP_NEAREST for stencil
texturing using DEPTH_STENCIL_TEXTURE_MODE? Or was this change meant to be
just for STENCIL_INDEX textures? Is there are a reason why
NEAREST_MIPMAP_NEAREST cannot also be used with depth stencil textures and
DEPTH_STENCIL_TEXTURE_MODE? Is this just an inconsistency in the GL spec?
Cheers,
Józef Kucia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161204/c5763171/attachment.html>
More information about the mesa-dev
mailing list