[Mesa-dev] [PATCH] format_unpack: add 8/16 rgba/rgb types.

Eric Anholt eric at anholt.net
Sun Nov 27 14:25:09 PST 2011


On Sun, 27 Nov 2011 20:54:34 +0000, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
> 
> fixing these makes piglit fbo-integer pass on softpipe.

I didn't do these because I wasn't sure how clamping and sign extension
were supposed to work in the pack path.  The specs have text on it, but
I couldn't make clear sense of it.  Do you have a solid idea, and if so
could we get a little bit of explanation in the switch statement maybe?

> +static void
>  unpack_int_rgba_RG_UINT32(const GLuint *src, GLuint dst[][4], GLuint n)
>  {
>     unsigned int i;
> @@ -1668,10 +1773,40 @@ _mesa_unpack_int_rgba_row(gl_format format, GLuint n,
>     case MESA_FORMAT_RGBA_INT32:
>        unpack_int_rgba_RGBA_UINT32(src, dst, n);
>        break;
> +
> +   case MESA_FORMAT_RGBA_UINT8:
> +      unpack_int_rgba_RGBA_UINT8(src, dst, n);
> +      break;
> +   case MESA_FORMAT_RGBA_INT8:
> +      unpack_int_rgba_RGBA_INT8(src, dst, n);
> +      break;
> +
> +   case MESA_FORMAT_RGBA_UINT16:
> +      unpack_int_rgba_RGBA_UINT16(src, dst, n);
> +      break;
> +   case MESA_FORMAT_RGBA_INT16:
> +      unpack_int_rgba_RGBA_INT16(src, dst, n);
> +      break;
> +

Having the ordering of cases be 32, 8, 16 looks odd.  Let's flip it
around to either 8, 16, 32 or 32, 16, 8.

> +   case MESA_FORMAT_RGB_UINT8:
> +      unpack_int_rgba_RGB_UINT8(src, dst, n);
> +      break;
> +   case MESA_FORMAT_RGB_INT8:
> +      unpack_int_rgba_RGB_INT8(src, dst, n);
> +      break;
> +
> +   case MESA_FORMAT_RGB_UINT16:
> +      unpack_int_rgba_RGB_UINT16(src, dst, n);
> +      break;
> +   case MESA_FORMAT_RGB_INT16:
> +      unpack_int_rgba_RGB_INT16(src, dst, n);
> +      break;
> +
>     case MESA_FORMAT_RG_UINT32:
>     case MESA_FORMAT_RG_INT32:
>        unpack_int_rgba_RG_UINT32(src, dst, n);

No RG/R/A/L/I cases make me sad.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20111127/f1b061c9/attachment.pgp>


More information about the mesa-dev mailing list