[Mesa-dev] [PATCH] i965: Accelerate uploads of RGBA and BGRA GL_UNSIGNED_INT_8_8_8_8_REV textures

Kenneth Graunke kenneth at whitecape.org
Wed Jul 23 15:59:04 PDT 2014


On Friday, July 18, 2014 06:25:25 PM Jason Ekstrand wrote:
> Since intel is always going to be little-endian,
> GL_UNSIGNED_INT_8_8_8_8_REV is the same as GL_BYTE for RGBA and BGRA

I think you meant GL_UNSIGNED_BYTE.

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

> textures, so the same acceleration code will work.  We might as well use
> it.
> ---
>  src/mesa/drivers/dri/i965/intel_tex_subimage.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/intel_tex_subimage.c b/src/mesa/drivers/dri/i965/intel_tex_subimage.c
> index c73cf10..875190f 100644
> --- a/src/mesa/drivers/dri/i965/intel_tex_subimage.c
> +++ b/src/mesa/drivers/dri/i965/intel_tex_subimage.c
> @@ -560,7 +560,7 @@ intel_texsubimage_tiled_memcpy(struct gl_context * ctx,
>      * we need tests.
>      */
>     if (!brw->has_llc ||
> -       type != GL_UNSIGNED_BYTE ||
> +       !(type == GL_UNSIGNED_BYTE || type == GL_UNSIGNED_INT_8_8_8_8_REV) ||
>         texImage->TexObject->Target != GL_TEXTURE_2D ||
>         pixels == NULL ||
>         _mesa_is_bufferobj(packing->BufferObj) ||
> @@ -573,6 +573,10 @@ intel_texsubimage_tiled_memcpy(struct gl_context * ctx,
>         packing->Invert)
>        return false;
>  
> +   if (type == GL_UNSIGNED_INT_8_8_8_8_REV &&
> +       !(format == GL_RGBA || format == GL_BGRA))
> +      return false; /* Invalid type/format combination */
> +
>     if ((texImage->TexFormat == MESA_FORMAT_L_UNORM8 && format == GL_LUMINANCE) ||
>         (texImage->TexFormat == MESA_FORMAT_A_UNORM8 && format == GL_ALPHA)) {
>        cpp = 1;
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140723/57c648a1/attachment.sig>


More information about the mesa-dev mailing list