[Mesa-dev] GL_DEPTH_STENCIL_TEXTURE_MODE and filter type

Roland Scheidegger sroland at vmware.com
Mon Dec 5 12:25:47 UTC 2016


According to the bug, this was a mistake in ARB_stencil_texturing, which
was fixed in GL 4.5. Albeit since the extension itself wasn't updated,
I'm not entirely sure it really is supposed to work without gl 4.5 but
this extension.
In any case, with 4.5 this clearly is a bug and it should work. Seems
like mesa would indeed consider the texture incomplete in
_mesa_is_texture_complete() based on the extension spec wording mistakenly.

Roland




Am 04.12.2016 um 15:24 schrieb Józef Kucia:
> 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
> 
> 
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 



More information about the mesa-dev mailing list