Add support for RGBA8 and RGBX8 textures in intel_texsubimage_tiled_memcpy
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 17 Jul 2014 21:40:23 +0000 (14:40 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 18 Jul 2014 01:20:09 +0000 (18:20 -0700)
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
src/mesa/drivers/dri/i965/intel_tex_subimage.c

index 04cbc4c5aee35ed77afd334e77e4d691f1dba9a0..c73cf10f58817b4b81f1206ecb5f0c8710960b78 100644 (file)
@@ -585,6 +585,17 @@ intel_texsubimage_tiled_memcpy(struct gl_context * ctx,
       } else if (format == GL_RGBA) {
          mem_copy = rgba8_copy;
       }
+   } else if ((texImage->TexFormat == MESA_FORMAT_R8G8B8A8_UNORM) ||
+              (texImage->TexFormat == MESA_FORMAT_R8G8B8X8_UNORM)) {
+      cpp = 4;
+      if (format == GL_BGRA) {
+         /* Copying from RGBA to BGRA is the same as BGRA to RGBA so we can
+          * use the same function.
+          */
+         mem_copy = rgba8_copy;
+      } else if (format == GL_RGBA) {
+         mem_copy = memcpy;
+      }
    }
    if (!mem_copy)
       return false;