[Mesa-dev] [PATCH] mesa/st: Use more precision for GL_UNSIGNED_BYTE_3_3_2(_REV)

Brian Paul brianp at vmware.com
Thu Oct 25 07:52:07 PDT 2012


On 10/25/2012 08:47 AM, jfonseca at vmware.com wrote:
> From: José Fonseca<jfonseca at vmware.com>
>
> 4bits and 3bits quantitization values differ significantly for
> values other than 0 and 1.
>
> Fixes piglit draw-pixels for softpipe/llvmpipe.
> ---
>   src/mesa/state_tracker/st_cb_drawpixels.c |    3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
> index 4e2edd2..4532ded 100644
> --- a/src/mesa/state_tracker/st_cb_drawpixels.c
> +++ b/src/mesa/state_tracker/st_cb_drawpixels.c
> @@ -396,6 +396,9 @@ internal_format(struct gl_context *ctx, GLenum format, GLenum type)
>
>            case GL_UNSIGNED_BYTE_3_3_2:
>            case GL_UNSIGNED_BYTE_2_3_3_REV:
> +	    /* GL_RGBA4 introduces too much error for normalized values */
> +            return GL_RGBA8;
> +
>            case GL_UNSIGNED_SHORT_4_4_4_4:
>            case GL_UNSIGNED_SHORT_4_4_4_4_REV:
>               return GL_RGBA4;

Probably a candidate for stable branches.

Reviewed-by: Brian Paul <brianp at vmware.com>


More information about the mesa-dev mailing list