diff options
author | Charmaine Lee <[email protected]> | 2016-10-26 16:15:23 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2016-11-03 14:29:23 -0600 |
commit | 8a195e2fd59886b4f47c7761bda96478bb0f8f95 (patch) | |
tree | 0db28b278146bbd22e54f2ad45e9baa265e3bbda /src/gallium/drivers/svga/svga_screen_cache.c | |
parent | 06bba2452f00d6fa8a4b233567995af0480a3f4d (diff) |
svga: invalidate new surface before it is bound to a render target view
Invalidate a "new" surface before it is bound to a render target view or
depth stencil view in order to avoid the unnecessary host side copy
of the surface data before it is rendered to.
Note that, recycled surface is already invalidated before it is reused.
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga/svga_screen_cache.c')
-rw-r--r-- | src/gallium/drivers/svga/svga_screen_cache.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_screen_cache.c b/src/gallium/drivers/svga/svga_screen_cache.c index 86a04136e64..76e34258f9c 100644 --- a/src/gallium/drivers/svga/svga_screen_cache.c +++ b/src/gallium/drivers/svga/svga_screen_cache.c @@ -433,10 +433,12 @@ svga_screen_cache_init(struct svga_screen *svgascreen) * allocate a new surface. * \param bind_flags bitmask of PIPE_BIND_x flags * \param usage one of PIPE_USAGE_x values + * \param validated return True if the surface is a reused surface */ struct svga_winsys_surface * svga_screen_surface_create(struct svga_screen *svgascreen, unsigned bind_flags, enum pipe_resource_usage usage, + boolean *validated, struct svga_host_surface_cache_key *key) { struct svga_winsys_screen *sws = svgascreen->sws; @@ -510,6 +512,7 @@ svga_screen_surface_create(struct svga_screen *svgascreen, key->numMipLevels, key->numFaces, key->arraySize); + *validated = TRUE; } } @@ -536,6 +539,8 @@ svga_screen_surface_create(struct svga_screen *svgascreen, key->size.width, key->size.height, key->size.depth); + + *validated = FALSE; } return handle; |