<div dir="ltr"><div><div>Hello,<br><br>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:<br><br>"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.".<br><br>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:<br><br>"Add NEAREST_MIPMAP_NEAREST to the allowed filter modes for STENCIL_INDEX textures in <br>section 8.17 (Bug 12791).".<br><br>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.<br><br></div>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?<br></div><div><div><br>Cheers,<br>Józef Kucia<br><br></div></div></div>