Mesa (master): r300g: correctly determine if a texture is blittable in texture_get_transfer

Marek Olšák mareko at kemper.freedesktop.org
Sun Feb 13 08:15:26 UTC 2011


Module: Mesa
Branch: master
Commit: e6e4860555068af8aba79d620acafc5fd5214d1f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e6e4860555068af8aba79d620acafc5fd5214d1f

Author: Marek Olšák <maraeo at gmail.com>
Date:   Sun Feb 13 07:06:22 2011 +0100

r300g: correctly determine if a texture is blittable in texture_get_transfer

---

 src/gallium/drivers/r300/r300_transfer.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_transfer.c b/src/gallium/drivers/r300/r300_transfer.c
index b557212..30de9ec 100644
--- a/src/gallium/drivers/r300/r300_transfer.c
+++ b/src/gallium/drivers/r300/r300_transfer.c
@@ -87,6 +87,8 @@ r300_texture_get_transfer(struct pipe_context *ctx,
     struct r300_transfer *trans;
     struct pipe_resource base;
     boolean referenced_cs, referenced_hw, blittable;
+    const struct util_format_description *desc =
+        util_format_description(texture->format);
 
     referenced_cs =
         r300->rws->cs_is_buffer_referenced(r300->cs, tex->cs_buf);
@@ -97,9 +99,8 @@ r300_texture_get_transfer(struct pipe_context *ctx,
             r300->rws->buffer_is_busy(tex->buf);
     }
 
-    blittable = ctx->screen->is_format_supported(
-            ctx->screen, texture->format, texture->target, 0,
-            PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET, 0);
+    blittable = desc->layout == UTIL_FORMAT_LAYOUT_PLAIN ||
+                desc->layout == UTIL_FORMAT_LAYOUT_S3TC;
 
     trans = CALLOC_STRUCT(r300_transfer);
     if (trans) {
@@ -113,7 +114,7 @@ r300_texture_get_transfer(struct pipe_context *ctx,
          * for this transfer.
          * Also make write transfers pipelined. */
         if (tex->tex.microtile || tex->tex.macrotile[level] ||
-            ((referenced_hw & !(usage & PIPE_TRANSFER_READ)) && blittable)) {
+            (referenced_hw && blittable && !(usage & PIPE_TRANSFER_READ))) {
             if (r300->blitter->running) {
                 fprintf(stderr, "r300: ERROR: Blitter recursion in texture_get_transfer.\n");
                 os_break();




More information about the mesa-commit mailing list