[Piglit] [PATCH] getteximage-formats: Disable dithering during glDrawPixels

Kenneth Graunke kenneth at whitecape.org
Mon Jan 30 19:38:03 UTC 2017


On Monday, January 30, 2017 11:12:44 AM PST Chad Versace wrote:
> The test generates a mipmap by "copying" a client-array of pixels to
> miplevel 0 with glDrawPixels, then calling glGenerateMipmap. The test
> expects the rendered level 0 to match the client-array source. Dithering
> during glDrawPixels inteferes with that expectation.
> 
> Fixes on Intel Skylake:
>   spec.ext_framebuffer_object.getteximage-formats init-by-clear-and-render
>   spec.ext_framebuffer_object.getteximage-formats init-by-render
> 
> Regressed by Mesa:
>   commit c4b87f129eb036c9615df3adcc1cebd9df10fc84
>   Author: Chad Versace <chadversary at chromium.org>
>   Subject: meta: Disable dithering during glGenerateMipmap
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99266
> Cc: Mark Janes <mark.a.janes at intel.com>
> Cc: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  tests/texturing/getteximage-formats.c | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
> 
> diff --git a/tests/texturing/getteximage-formats.c b/tests/texturing/getteximage-formats.c
> index 6f4fb029e..02d78d441 100644
> --- a/tests/texturing/getteximage-formats.c
> +++ b/tests/texturing/getteximage-formats.c
> @@ -110,8 +110,33 @@ make_texture_image(GLenum intFormat, GLubyte upperRightTexel[4])
>  
>  		glViewport(0, 0, TEX_SIZE, TEX_SIZE);
>  
> +		/* Disable dithering during glDrawPixels to prevent
> +		 * disagreement with glGenerateMipmap.  The spec requires
> +		 * glDrawPixels to respect the dither state, but the spec
> +		 * strongly implies that glGenerateMipmap should not dither.
> +		 *
> +		 * On dithering and glDrawPixels, see the OpenGL 4.5
> +		 * Compatibility Specification, Section 18.1 Drawing Pixels,
> +		 * p620:
> +		 *
> +		 *   Once pixels are transferred, DrawPixels performs final
> +		 *   conversion on pixel values [...] which are processed in
> +		 *   the same fashion as fragments generated by rasterization
> +		 *   (see chapters 15 and 16).
> +		 *
> +		 * On dithering and glGenerateMipmap, see the Mesa commit
> +		 * message in:
> +		 *
> +		 *   commit c4b87f129eb036c9615df3adcc1cebd9df10fc84
> +		 *   Author: Chad Versace <chadversary at chromium.org>
> +		 *   Date:   Thu Dec 29 13:05:27 2016 -0800
> +		 *   Subject: meta: Disable dithering during glGenerateMipmap
> +		 */
> +		glDisable(GL_DITHER);
>  		glWindowPos2iARB(0, 0);
>  		glDrawPixels(TEX_SIZE, TEX_SIZE, GL_RGBA, GL_UNSIGNED_BYTE, tex);
> +		glEnable(GL_DITHER);
> +
>  		glGenerateMipmap(GL_TEXTURE_2D);
>  
>  		glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
> 

Thank you, Chad!

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20170130/c4c7900a/attachment-0001.sig>


More information about the Piglit mailing list