diff options
author | Charmaine Lee <[email protected]> | 2016-09-06 11:29:41 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2016-09-17 10:24:13 -0600 |
commit | f1b3374d28577ca0b84ce1fbab171c39a637d3df (patch) | |
tree | c2d708dd1ac83d3390962b5dc8c9f7d85af4ec60 /src/gallium/drivers/svga/svga_resource_buffer_upload.c | |
parent | a9c4a861d5d6bb88c9e6c375403c3985187fd453 (diff) |
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 <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga/svga_resource_buffer_upload.c')
-rw-r--r-- | src/gallium/drivers/svga/svga_resource_buffer_upload.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_resource_buffer_upload.c b/src/gallium/drivers/svga/svga_resource_buffer_upload.c index 7ecf95c1af7..ac8cedfd3b7 100644 --- a/src/gallium/drivers/svga/svga_resource_buffer_upload.c +++ b/src/gallium/drivers/svga/svga_resource_buffer_upload.c @@ -166,6 +166,14 @@ svga_buffer_create_host_surface(struct svga_screen *ss, if (sbuf->bind_flags & PIPE_BIND_SAMPLER_VIEW) sbuf->key.flags |= SVGA3D_SURFACE_BIND_SHADER_RESOURCE; + if (!sbuf->bind_flags && sbuf->b.b.usage == PIPE_USAGE_STAGING) { + /* This surface is to be used with the + * SVGA3D_CMD_DX_TRANSFER_FROM_BUFFER command, and no other + * bind flags are allowed to be set for this surface. + */ + sbuf->key.flags = SVGA3D_SURFACE_TRANSFER_FROM_BUFFER; + } + sbuf->key.size.width = sbuf->b.b.width0; sbuf->key.size.height = 1; sbuf->key.size.depth = 1; |