[Mesa-stable] [Mesa-dev] [PATCH] meta: Disable dithering during glGenerateMipmap

Jason Ekstrand jason at jlekstrand.net
Thu Dec 29 23:02:46 UTC 2016


On Dec 29, 2016 4:58 PM, "Kenneth Graunke" <kenneth at whitecape.org> wrote:

On Thursday, December 29, 2016 1:25:57 PM PST Chad Versace wrote:
> Fixes tests 'dEQP-GLES3.functional.texture.mipmap.*.generate.rgba5551*' on
> Intel Broadwell 0x1616.
>
> The GL 4.5 spec describes the algorithm of glGenerateMipmap as:
>
>     The contents of the derived images are computed by repeated, filtered
>     reduction of the level base image.  [...] No particular filter
algorithm is
>     required, though a box filter is recommended as the default filter.
>
> Consider a texture for which all pixels are identical at level 0.
> From the spec's description above, one may reasonably assume that the
"filtered
> reduction" of level 0 produces a new miplevel for which again all pixels
are
> identical. For any 2x2 subspan of identical pixels, it is difficult to
see how
> the "filtered reduction" of that subspan can produce a pixel that differs
from
> the source pixels.
>
> Dithering during _mesa_meta_GenerateMipmap() violated that reasonable
> assumption.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99210
> Cc: mesa-stable at lists.freedesktop.org
> ---
>  src/mesa/drivers/common/meta_generate_mipmap.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/mesa/drivers/common/meta_generate_mipmap.c
b/src/mesa/drivers/common/meta_generate_mipmap.c
> index bbe9d6d886..55093e9553 100644
> --- a/src/mesa/drivers/common/meta_generate_mipmap.c
> +++ b/src/mesa/drivers/common/meta_generate_mipmap.c
> @@ -182,6 +182,7 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx,
GLenum target,
>
>     _mesa_meta_begin(ctx, MESA_META_ALL & ~MESA_META_DRAW_BUFFERS);
>     _mesa_ColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
> +   _mesa_Disable(GL_DITHER);
>
>     /* Choose between glsl version and fixed function version of
>      * GenerateMipmap function.
>

Good catch!  That makes sense.  I verified that the meta begin flags
will restore the dither mode at the end.


Die meta! Die!

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

_______________________________________________
mesa-dev mailing list
mesa-dev at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-stable/attachments/20161229/bd51393a/attachment.html>


More information about the mesa-stable mailing list