diff options
author | Charmaine Lee <[email protected]> | 2017-03-22 12:45:11 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2017-04-07 13:46:43 -0600 |
commit | a08e3b88ab71b147145f60e56ce02392437c6866 (patch) | |
tree | 3ebed47432fa2a65d174e522e8ea084574c2a847 /src/gallium/drivers/svga/svga_surface.c | |
parent | 02c9bf2d54cc166882a10a5b54b14dda832b4ecd (diff) |
svga: add a reset flag to svga_propagate_surface()
The reset flag specifies if the dirty bit needs to be reset
after the surface is propagated to the texture. This is used
to make sure that the dirty bit is not reset and stay unset
before the surface is unbound.
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga/svga_surface.c')
-rw-r--r-- | src/gallium/drivers/svga/svga_surface.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/gallium/drivers/svga/svga_surface.c b/src/gallium/drivers/svga/svga_surface.c index d9c1e2502fb..846acccacec 100644 --- a/src/gallium/drivers/svga/svga_surface.c +++ b/src/gallium/drivers/svga/svga_surface.c @@ -618,7 +618,8 @@ svga_mark_surfaces_dirty(struct svga_context *svga) * pipe is optional context to inline the blit command in. */ void -svga_propagate_surface(struct svga_context *svga, struct pipe_surface *surf) +svga_propagate_surface(struct svga_context *svga, struct pipe_surface *surf, + boolean reset) { struct svga_surface *s = svga_surface(surf); struct svga_texture *tex = svga_texture(surf->texture); @@ -629,7 +630,14 @@ svga_propagate_surface(struct svga_context *svga, struct pipe_surface *surf) SVGA_STATS_TIME_PUSH(ss->sws, SVGA_STATS_TIME_PROPAGATESURFACE); - s->dirty = FALSE; + /* Reset the dirty flag if specified. This is to ensure that + * the dirty flag will not be reset and stay unset when the backing + * surface is still being bound and rendered to. + * The reset flag will be set to TRUE when the surface is propagated + * and will be unbound. + */ + s->dirty = !reset; + ss->texture_timestamp++; svga_age_texture_view(tex, surf->u.tex.level); @@ -693,12 +701,12 @@ svga_propagate_rendertargets(struct svga_context *svga) for (i = 0; i < svga->state.hw_draw.num_rendertargets; i++) { struct pipe_surface *s = svga->state.hw_draw.rtv[i]; if (s) { - svga_propagate_surface(svga, s); + svga_propagate_surface(svga, s, FALSE); } } if (svga->state.hw_draw.dsv) { - svga_propagate_surface(svga, svga->state.hw_draw.dsv); + svga_propagate_surface(svga, svga->state.hw_draw.dsv, FALSE); } } |