i965: Don't use tiled_memcpy to download from RGBX or BGRX surfaces
authorJason Ekstrand <jason.ekstrand@intel.com>
Mon, 2 Feb 2015 17:49:44 +0000 (09:49 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 2 Feb 2015 18:18:42 +0000 (10:18 -0800)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88841

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/mesa/drivers/dri/i965/intel_pixel_read.c
src/mesa/drivers/dri/i965/intel_tex_image.c

index f3ab05ccbb8b5fbb263618a13381fbfcce91a0cd..df22a637dce639dc3d58af367ab5c173b0c4db0e 100644 (file)
@@ -132,6 +132,13 @@ intel_readpixels_tiled_memcpy(struct gl_context * ctx,
    if (rb->NumSamples > 1)
       return false;
 
+   /* We can't handle copying from RGBX or BGRX because the tiled_memcpy
+    * function doesn't set the last channel to 1.
+    */
+   if (rb->Format == MESA_FORMAT_B8G8R8X8_UNORM ||
+       rb->Format == MESA_FORMAT_R8G8B8X8_UNORM)
+      return false;
+
    if (!intel_get_memcpy(rb->Format, format, type, &mem_copy, &cpp))
       return false;
 
index 53efbbb2f740698048bae6c5f6bcc53a701bd920..6eebfc4bd4bb38c017b658198da8f586f176ff88 100644 (file)
@@ -392,6 +392,13 @@ intel_gettexsubimage_tiled_memcpy(struct gl_context *ctx,
        packing->Invert)
       return false;
 
+   /* We can't handle copying from RGBX or BGRX because the tiled_memcpy
+    * function doesn't set the last channel to 1.
+    */
+   if (texImage->TexFormat == MESA_FORMAT_B8G8R8X8_UNORM ||
+       texImage->TexFormat == MESA_FORMAT_R8G8B8X8_UNORM)
+      return false;
+
    if (!intel_get_memcpy(texImage->TexFormat, format, type, &mem_copy, &cpp))
       return false;