Commit 32dd62b8 by Jamie Madill Committed by Commit Bot

Allow LINEAR filtering on OES_depth_texture formats.

The ES3 spec and this extension lead to some awkward interactions. The extension doesn't mention allowed filtering modes, so be default it allows both linear and nearest. ES3 however, very clearly restricts any depth texture (any texture with effective internal format which has depth or stencil bits) to only use nearest filtering. This then breaks compatibility with the legazy unsized formats. Choose to be slightly non-conformant here, and allow linear filtering for the older unsized formats. Although this could lead to problems down the line, it is consistent with existing ES drivers in practice. Other future options might be to override the behaviour of the filter to use nearest when using WebGL validation compatibility. BUG=chromium:649200 Change-Id: I4ee7608dd04d1fd238385aefee32c8c9c1e80ca0 Reviewed-on: https://chromium-review.googlesource.com/388759Reviewed-by: 's avatarZhenyao Mo <zmo@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 28a97ee1
......@@ -301,9 +301,13 @@ bool TextureState::computeSamplerCompleteness(const SamplerState &samplerState,
// depth and stencil format (see table 3.13), the value of TEXTURE_COMPARE_-
// MODE is NONE, and either the magnification filter is not NEAREST or the mini-
// fication filter is neither NEAREST nor NEAREST_MIPMAP_NEAREST.
if (baseImageDesc.format.info->depthBits > 0 && data.getClientMajorVersion() > 2)
if (baseImageDesc.format.info->depthBits > 0 && data.getClientMajorVersion() >= 3)
{
if (samplerState.compareMode == GL_NONE)
// Note: we restrict this validation to sized types. For the OES_depth_textures
// extension, due to some underspecification problems, we must allow linear filtering
// for legacy compatibility with WebGL 1.
// See http://crbug.com/649200
if (samplerState.compareMode == GL_NONE && baseImageDesc.format.sized)
{
if ((samplerState.minFilter != GL_NEAREST &&
samplerState.minFilter != GL_NEAREST_MIPMAP_NEAREST) ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment