svga: remove redundant surface propagation

Currently, surface propagation for colliding render target resource is
done at framebuffer emit time for vgpu10. This patch
adds the surface propagation for non-vgpu10 path to emit_fb_vgpu9()
and removes the redundant surface copy at set time.

Tested with MTT glretrace, piglit, NobelClinicianViewer, Turbine, Cinebench.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
This commit is contained in:
Charmaine Lee
2017-04-03 12:57:18 -07:00
committed by Brian Paul
parent 35a748e79c
commit b1c964447a
2 changed files with 8 additions and 12 deletions
-12
View File
@@ -121,18 +121,6 @@ svga_set_framebuffer_state(struct pipe_context *pipe,
dst->height = fb->height;
dst->nr_cbufs = fb->nr_cbufs;
/* Check if we need to propagate any of the render targets which we may
* be unbinding.
*/
for (i = 0; i < dst->nr_cbufs; i++) {
struct pipe_surface *s = i < fb->nr_cbufs ? fb->cbufs[i] : NULL;
if (dst->cbufs[i] && dst->cbufs[i] != s) {
if (svga_surface_needs_propagation(dst->cbufs[i])) {
svga_propagate_surface(svga, dst->cbufs[i], FALSE);
}
}
}
/* Check that all surfaces are the same size.
* Actually, the virtual hardware may support rendertargets with
* different size, depending on the host API and driver,
@@ -71,6 +71,10 @@ emit_fb_vgpu9(struct svga_context *svga)
if (svga->curr.nr_fbs++ > MAX_RT_PER_BATCH)
return PIPE_ERROR_OUT_OF_MEMORY;
/* Check to see if we need to propagate the render target surface */
if (hw->cbufs[i] && svga_surface_needs_propagation(hw->cbufs[i]))
svga_propagate_surface(svga, hw->cbufs[i], TRUE);
ret = SVGA3D_SetRenderTarget(svga->swc, SVGA3D_RT_COLOR0 + i,
curr->cbufs[i]);
if (ret != PIPE_OK)
@@ -85,6 +89,10 @@ emit_fb_vgpu9(struct svga_context *svga)
if (ret != PIPE_OK)
return ret;
/* Check to see if we need to propagate the depth stencil surface */
if (hw->zsbuf && svga_surface_needs_propagation(hw->zsbuf))
svga_propagate_surface(svga, hw->zsbuf, TRUE);
if (curr->zsbuf &&
util_format_is_depth_and_stencil(curr->zsbuf->format)) {
ret = SVGA3D_SetRenderTarget(svga->swc, SVGA3D_RT_STENCIL,