i965: use pack/unpackDouble lowering
[mesa.git] / src / gallium / drivers / svga / svga_resource_texture.c
index ae5122843a6a48e1e6f97926dd4a65b663d83c37..b7e8549b7828b7192f7f168ff5b1ec7d5e4d919c 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;
@@ -837,6 +839,17 @@ svga_texture_create(struct pipe_screen *screen,
 
    tex->key.cachable = 1;
 
+   if ((bindings & (PIPE_BIND_RENDER_TARGET | PIPE_BIND_DEPTH_STENCIL)) &&
+       !(bindings & PIPE_BIND_SAMPLER_VIEW)) {
+      /* Also check if the format can be sampled from */
+      if (screen->is_format_supported(screen, template->format,
+                                      template->target,
+                                      template->nr_samples,
+                                      PIPE_BIND_SAMPLER_VIEW)) {
+         bindings |= PIPE_BIND_SAMPLER_VIEW;
+      }
+   }
+
    if (bindings & PIPE_BIND_SAMPLER_VIEW) {
       tex->key.flags |= SVGA3D_SURFACE_HINT_TEXTURE;
       tex->key.flags |= SVGA3D_SURFACE_BIND_SHADER_RESOURCE;