Merge commit 'origin/master' into gallium-msaa
[mesa.git] / src / gallium / drivers / r300 / r300_blit.c
index e15c71eef65999ec24dd0857e91ff35816b8e68c..85c2c1490167cfc8fcc7730364229342748d0758 100644 (file)
@@ -126,12 +126,19 @@ void r300_surface_copy(struct pipe_context* pipe,
     enum pipe_format old_format = dst->texture->format;
     enum pipe_format new_format = old_format;
 
-    assert(dst->texture->format == src->texture->format);
+    if (dst->texture->format != src->texture->format) {
+        debug_printf("r300: Implementation error: Format mismatch in %s\n"
+            "    : src: %s dst: %s\n", __FUNCTION__,
+            util_format_short_name(src->texture->format),
+            util_format_short_name(dst->texture->format));
+        debug_assert(0);
+    }
 
     if (!pipe->screen->is_format_supported(pipe->screen,
                                            old_format, src->texture->target,
                                            PIPE_BIND_RENDER_TARGET |
-                                           PIPE_BIND_SAMPLER_VIEW, 0)) {
+                                           PIPE_BIND_SAMPLER_VIEW, 0) &&
+        util_format_is_plain(old_format)) {
         switch (util_format_get_blocksize(old_format)) {
             case 1:
                 new_format = PIPE_FORMAT_I8_UNORM;
@@ -148,7 +155,7 @@ void r300_surface_copy(struct pipe_context* pipe,
             default:
                 debug_printf("r300: surface_copy: Unhandled format: %s. Falling back to software.\n"
                              "r300: surface_copy: Software fallback doesn't work for tiled textures.\n",
-                             util_format_name(old_format));
+                             util_format_short_name(old_format));
         }
     }