intel: Add support for blit copies of >32bpp formats.
authorEric Anholt <eric@anholt.net>
Sat, 16 Apr 2011 01:15:59 +0000 (18:15 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 20 Apr 2011 17:35:42 +0000 (10:35 -0700)
The blitter only does up 32bpp at a time, so we handle it by mangling
coordinates and calling the surface 32bpp.

Fixes ARB_texture_rg/fbo-generatemipmap-formats-float with ARB_texture_float.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/drivers/dri/intel/intel_blit.c

index 487c9ea7818240c75cfac9c24122b47d5c235f1e..579a45b5aafdc5bcb763d179aa602f0fcb91028c 100644 (file)
@@ -146,6 +146,17 @@ intelEmitCopyBlit(struct intel_context *intel,
    src_pitch *= cpp;
    dst_pitch *= cpp;
 
+   /* For big formats (such as floating point), do the copy using 32bpp and
+    * multiply the coordinates.
+    */
+   if (cpp > 4) {
+      assert(cpp % 4 == 0);
+      dst_x *= cpp / 4;
+      dst_x2 *= cpp / 4;
+      src_x *= cpp / 4;
+      cpp = 4;
+   }
+
    BR13 = br13_for_cpp(cpp) | translate_raster_op(logic_op) << 16;
 
    switch (cpp) {