From: Chris Forbes Date: Sun, 16 Mar 2014 19:03:38 +0000 (+1300) Subject: mesa: fix packing of float texels to GL_SHORT/GL_BYTE X-Git-Tag: upstream/10.3~2674 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a421be1dcbf0c8aca4ec0a1862299c27c04d7e6c;p=platform%2Fupstream%2Fmesa.git mesa: fix packing of float texels to GL_SHORT/GL_BYTE Previously, we would unpack the texels to floats using *_TO_FLOAT_TEX, and then pack them into the desired format using FLOAT_TO_*. Unfortunately, this isn't quite the inverse operation, and so some texel values would end up off-by-one. This fixes the GL_RGB8_SNORM and GL_RGB16_SNORM subcases in piglit's arb_texture_view-format-consistency-get test on i965. The similar 1-, 2- and 4-component cases already worked because they took the memcpy path rather than repacking. Signed-off-by: Chris Forbes Reviewed-by: Brian Paul Reviewed-by: Kenneth Graunke Acked-by: Eric Anholt --- diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c index d976e5a..1df6568 100644 --- a/src/mesa/main/pack.c +++ b/src/mesa/main/pack.c @@ -1489,72 +1489,72 @@ _mesa_pack_rgba_span_float(struct gl_context *ctx, GLuint n, GLfloat rgba[][4], switch (dstFormat) { case GL_RED: for (i=0;i