Squashed commit of gallium-no-texture-blanket
[mesa.git] / src / gallium / drivers / svga / svga_screen_texture.c
index 4b045c44d894f9ccc28918d93a92dd407e6f6233..5b581debfc7d9c51c0acd6ad7c4d1809a5607f69 100644 (file)
@@ -359,71 +359,7 @@ error1:
 }
 
 
-static struct pipe_texture *
-svga_texture_blanket(struct pipe_screen * screen,
-                     const struct pipe_texture *base,
-                     const unsigned *stride,
-                     struct pipe_buffer *buffer)
-{
-   struct svga_texture *tex;
-   struct svga_buffer *sbuf = svga_buffer(buffer);
-   struct svga_winsys_screen *sws = svga_winsys_screen(screen);
-   assert(screen);
-
-   /* Only supports one type */
-   if (base->target != PIPE_TEXTURE_2D ||
-       base->last_level != 0 ||
-       base->depth0 != 1) {
-      return NULL;
-   }
-
-   /**
-    * We currently can't do texture blanket on
-    * SVGA3D_BUFFER. Need to blit to a temporary surface?
-    */
-
-   assert(sbuf->handle);
-   if (!sbuf->handle)
-      return NULL;
-
-   if (svga_translate_format(base->format) != sbuf->key.format) {
-      unsigned f1 = svga_translate_format(base->format);
-      unsigned f2 = sbuf->key.format;
-
-      /* It's okay for XRGB and ARGB or depth with/out stencil to get mixed up */
-      if ( !( (f1 == SVGA3D_X8R8G8B8 && f2 == SVGA3D_A8R8G8B8) ||
-              (f1 == SVGA3D_A8R8G8B8 && f2 == SVGA3D_X8R8G8B8) ||
-              (f1 == SVGA3D_Z_D24X8 && f2 == SVGA3D_Z_D24S8) ) ) {
-         debug_printf("%s wrong format %u != %u\n", __FUNCTION__, f1, f2);
-         return NULL;
-      }
-   }
-
-   tex = CALLOC_STRUCT(svga_texture);
-   if (!tex)
-      return NULL;
-
-   tex->base = *base;
-   
 
-   if (sbuf->key.format == 1)
-      tex->base.format = PIPE_FORMAT_B8G8R8X8_UNORM;
-   else if (sbuf->key.format == 2)
-      tex->base.format = PIPE_FORMAT_B8G8R8A8_UNORM;
-
-   pipe_reference_init(&tex->base.reference, 1);
-   tex->base.screen = screen;
-
-   SVGA_DBG(DEBUG_DMA, "blanket sid %p\n", sbuf->handle);
-
-   /* We don't own this storage, so don't try to cache it.
-    */
-   assert(sbuf->key.cachable == 0);
-   tex->key.cachable = 0;
-   sws->surface_reference(sws, &tex->handle, sbuf->handle);
-
-   return &tex->base;
-}
 
 
 static struct pipe_texture *
@@ -984,7 +920,6 @@ svga_screen_init_texture_functions(struct pipe_screen *screen)
    screen->texture_destroy = svga_texture_destroy;
    screen->get_tex_surface = svga_get_tex_surface;
    screen->tex_surface_destroy = svga_tex_surface_destroy;
-   screen->texture_blanket = svga_texture_blanket;
    screen->get_tex_transfer = svga_get_tex_transfer;
    screen->transfer_map = svga_transfer_map;
    screen->transfer_unmap = svga_transfer_unmap;