From a421be1dcbf0c8aca4ec0a1862299c27c04d7e6c Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Mon, 17 Mar 2014 08:03:38 +1300 Subject: [PATCH] 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 --- src/mesa/main/pack.c | 116 +++++++++++++++++++++---------------------- 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c index d976e5aae00..1df656832b8 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