summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/svga/svga_screen_buffer.c
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2009-11-24 21:13:18 +0000
committerKeith Whitwell <keithw@vmware.com>2009-11-24 21:15:35 +0000
commitf1ce37f74aff4854071fe5740b055718b2c0c789 (patch)
tree126a8e27f9d0f2cf718176387727eac9b69640db /src/gallium/drivers/svga/svga_screen_buffer.c
parent4509f3cbad2972b6fe4a722ed07904666122a759 (diff)
svga: cache textures as well as buffers
Diffstat (limited to 'src/gallium/drivers/svga/svga_screen_buffer.c')
-rw-r--r--src/gallium/drivers/svga/svga_screen_buffer.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gallium/drivers/svga/svga_screen_buffer.c b/src/gallium/drivers/svga/svga_screen_buffer.c
index 3b7811734e..101c7878bf 100644
--- a/src/gallium/drivers/svga/svga_screen_buffer.c
+++ b/src/gallium/drivers/svga/svga_screen_buffer.c
@@ -71,7 +71,10 @@ svga_buffer_create_host_surface(struct svga_screen *ss,
sbuf->key.numFaces = 1;
sbuf->key.numMipLevels = 1;
+ sbuf->key.cachable = 1;
+ SVGA_DBG(DEBUG_DMA, "surface_create for buffer sz %d\n", sbuf->base.size);
+
sbuf->handle = svga_screen_surface_create(ss, &sbuf->key);
if(!sbuf->handle)
return PIPE_ERROR_OUT_OF_MEMORY;
@@ -82,7 +85,7 @@ svga_buffer_create_host_surface(struct svga_screen *ss,
*/
sbuf->hw.flags.discard = TRUE;
- SVGA_DBG(DEBUG_DMA, " grab sid %p sz %d\n", sbuf->handle, sbuf->base.size);
+ SVGA_DBG(DEBUG_DMA, " --> got sid %p sz %d (buffer)\n", sbuf->handle, sbuf->base.size);
}
return PIPE_OK;
@@ -776,12 +779,11 @@ svga_screen_buffer_wrap_surface(struct pipe_screen *screen,
/*
* We are not the creator of this surface and therefore we must not
- * cache it for reuse. The caching code only caches SVGA3D_BUFFER surfaces
- * so make sure this isn't one of those.
+ * cache it for reuse. Set the cacheable flag to zero in the key to
+ * prevent this.
*/
-
- assert(format != SVGA3D_BUFFER);
sbuf->key.format = format;
+ sbuf->key.cachable = 0;
sws->surface_reference(sws, &sbuf->handle, srf);
return buf;