svga: mark the texture dirty for write transfer map only
authorCharmaine Lee <charmainel@vmware.com>
Thu, 21 Apr 2016 15:28:26 +0000 (08:28 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 25 Apr 2016 18:59:29 +0000 (12:59 -0600)
Instead of unconditionally mark the texture subresource dirty at transfer map,
we'll set the dirty bit for write transfer only.

Tested with lightsmark2008 and glretrace.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/drivers/svga/svga_resource_texture.c

index ae5122843a6a48e1e6f97926dd4a65b663d83c37..f176647dcf6d8a4e97dbc0e1fe9496cf93f6248e 100644 (file)
@@ -485,8 +485,10 @@ svga_texture_transfer_map(struct pipe_context *pipe,
             }
         }
       }
-      /* mark this texture level as dirty */
-      svga_set_texture_dirty(tex, st->slice, transfer->level);
+      if (transfer->usage & PIPE_TRANSFER_WRITE) {
+         /* mark this texture level as dirty */
+         svga_set_texture_dirty(tex, st->slice, transfer->level);
+      }
    }
 
    st->use_direct_map = use_direct_map;