aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/gallium/auxiliary/util/u_blit.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-03-05 10:23:14 +0100
committermarha <marha@users.sourceforge.net>2012-03-05 10:23:14 +0100
commit8db4c7567d495ef6f6162406394ac192e6c2cfe7 (patch)
tree9d8233b2f54ad198da3354aa9dbd8d0082156a9c /mesalib/src/gallium/auxiliary/util/u_blit.c
parentc14f2432d6bfb3de6c6289efd0471f038a289327 (diff)
parent50ace52bb8308fd62b8bad9ae912dc18c4ae32ff (diff)
downloadvcxsrv-8db4c7567d495ef6f6162406394ac192e6c2cfe7.tar.gz
vcxsrv-8db4c7567d495ef6f6162406394ac192e6c2cfe7.tar.bz2
vcxsrv-8db4c7567d495ef6f6162406394ac192e6c2cfe7.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/gallium/auxiliary/util/u_blit.c')
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_blit.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_blit.c b/mesalib/src/gallium/auxiliary/util/u_blit.c
index a10fd17cb..127973388 100644
--- a/mesalib/src/gallium/auxiliary/util/u_blit.c
+++ b/mesalib/src/gallium/auxiliary/util/u_blit.c
@@ -321,6 +321,26 @@ regions_overlap(int srcX0, int srcY0,
/**
+ * Can we blit from src format to dest format with a simple copy?
+ */
+static boolean
+formats_compatible(enum pipe_format src_format,
+ enum pipe_format dst_format)
+{
+ if (src_format == dst_format) {
+ return TRUE;
+ }
+ else {
+ const struct util_format_description *src_desc =
+ util_format_description(src_format);
+ const struct util_format_description *dst_desc =
+ util_format_description(dst_format);
+ return util_is_format_compatible(src_desc, dst_desc);
+ }
+}
+
+
+/**
* Copy pixel block from src surface to dst surface.
* Overlapping regions are acceptable.
* Flipping and stretching are supported.
@@ -377,7 +397,7 @@ util_blit_pixels_writemask(struct blit_state *ctx,
* no overlapping.
* Filter mode should not matter since there's no stretching.
*/
- if (dst_format == src_format &&
+ if (formats_compatible(src_format, dst_format) &&
srcX0 < srcX1 &&
dstX0 < dstX1 &&
srcY0 < srcY1 &&