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,
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)
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,