[Mesa-dev] [PATCH] mesa: fix indexing error in unpack_Z32_FLOAT_X24S8()

Kenneth Graunke kenneth at whitecape.org
Wed Nov 23 09:33:15 PST 2011


On 11/23/2011 07:40 AM, Brian Paul wrote:
> The source array elements are 8-bytes (float + uint) so we need
> to multiply the src index by 2 to get the right array stride.
> ---
>  src/mesa/main/format_unpack.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/src/mesa/main/format_unpack.c b/src/mesa/main/format_unpack.c
> index 080392f..15121fa 100644
> --- a/src/mesa/main/format_unpack.c
> +++ b/src/mesa/main/format_unpack.c
> @@ -648,7 +648,7 @@ unpack_Z32_FLOAT_X24S8(const void *src, GLfloat dst[][4], GLuint n)
>     for (i = 0; i < n; i++) {
>        dst[i][0] =
>        dst[i][1] =
> -      dst[i][2] = s[i];
> +      dst[i][2] = s[i * 2];
>        dst[i][3] = 1.0F;
>     }
>  }

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


More information about the mesa-dev mailing list