svga: add the has_backed_views flag

The new has_backed_views flag specifies if any of the render target
views or depth stencil view is a backing surface view.
The flag is used in svga_propagate_rendertargets() so it can return early
if there is no surface to propagate.

Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
Charmaine Lee
2017-03-22 10:46:54 -07:00
committed by Brian Paul
parent a421d45e61
commit 02c9bf2d54
3 changed files with 15 additions and 0 deletions
+1
View File
@@ -401,6 +401,7 @@ struct svga_hw_draw_state
unsigned default_constbuf_size[PIPE_SHADER_TYPES];
boolean rasterizer_discard; /* set if rasterization is disabled */
boolean has_backed_views; /* set if any of the rtv/dsv is a backed surface view */
};
@@ -174,6 +174,12 @@ emit_fb_vgpu10(struct svga_context *svga)
assert(svga_have_vgpu10(svga));
/* Reset the has_backed_views flag.
* The flag is set in svga_validate_surface_view() if
* a backed surface view is used.
*/
svga->state.hw_draw.has_backed_views = FALSE;
/* Setup render targets array. Note that we loop over the max of the
* number of previously bound buffers and the new buffers to unbind
* any previously bound buffers when the new number of buffers is less
+8
View File
@@ -428,6 +428,10 @@ svga_validate_surface_view(struct svga_context *svga, struct svga_surface *s)
"same resource used in shaderResource and renderTarget 0x%x\n",
s->handle);
s = create_backed_surface_view(svga, s);
if (s)
svga->state.hw_draw.has_backed_views = TRUE;
/* s may be null here if the function failed */
break;
}
@@ -678,6 +682,10 @@ svga_propagate_rendertargets(struct svga_context *svga)
{
unsigned i;
/* Early exit if there is no backing texture views in use */
if (!svga->state.hw_draw.has_backed_views)
return;
/* Note that we examine the svga->state.hw_draw.framebuffer surfaces,
* not the svga->curr.framebuffer surfaces, because it's the former
* surfaces which may be backing surface views (the actual render targets).