diff options
author | Charmaine Lee <charmainel@vmware.com> | 2016-09-06 11:29:41 -0700 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2016-09-17 10:24:13 -0600 |
commit | f1b3374d28577ca0b84ce1fbab171c39a637d3df (patch) | |
tree | c2d708dd1ac83d3390962b5dc8c9f7d85af4ec60 /src/gallium/drivers/svga/svga_resource_texture.h | |
parent | a9c4a861d5d6bb88c9e6c375403c3985187fd453 (diff) | |
download | external_mesa3d-f1b3374d28577ca0b84ce1fbab171c39a637d3df.zip external_mesa3d-f1b3374d28577ca0b84ce1fbab171c39a637d3df.tar.gz external_mesa3d-f1b3374d28577ca0b84ce1fbab171c39a637d3df.tar.bz2 |
svga: use upload buffer for upload texture.
With this patch, when running with vgpu10, instead of mapping directly to the
guest backed memory for texture update, we'll use the texture upload buffer
and use the transfer from buffer command to update the host side texture memory.
This optimization yields about 20% performance improvement with
Lightsmark2008 and about 40% with Tropics.
Tested with Lightsmark2008, Tropics, Heaven, MTT piglit, glretrace, conform.
Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/gallium/drivers/svga/svga_resource_texture.h')
-rw-r--r-- | src/gallium/drivers/svga/svga_resource_texture.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_resource_texture.h b/src/gallium/drivers/svga/svga_resource_texture.h index ffd5fea..ff46ed5 100644 --- a/src/gallium/drivers/svga/svga_resource_texture.h +++ b/src/gallium/drivers/svga/svga_resource_texture.h @@ -113,7 +113,22 @@ struct svga_transfer * big enough */ void *swbuf; + /* True if guest backed surface is supported and we can directly map + * to the surface for this transfer. + */ boolean use_direct_map; + + struct { + struct pipe_resource *buf; /* points to the upload buffer if this + * transfer is done via the upload buffer + * instead of directly mapping to the + * resource's surface. + */ + void *map; + unsigned offset; + SVGA3dBox box; + unsigned nlayers; + } upload; }; @@ -256,5 +271,22 @@ svga_texture_generate_mipmap(struct pipe_context *pipe, unsigned first_layer, unsigned last_layer); +boolean +svga_texture_transfer_map_upload_create(struct svga_context *svga); + +void +svga_texture_transfer_map_upload_destroy(struct svga_context *svga); + +boolean +svga_texture_transfer_map_can_upload(struct svga_context *svga, + struct svga_transfer *st); + +void * +svga_texture_transfer_map_upload(struct svga_context *svga, + struct svga_transfer *st); + +void +svga_texture_transfer_unmap_upload(struct svga_context *svga, + struct svga_transfer *st); #endif /* SVGA_TEXTURE_H */ |