mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 16:08:04 +02:00
mesa/st: create new surfaces before destroying old ones when updating attachments
try to avoid patterns that would destroy surfaces for drivers that cache them for deduplication purposes Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12651>
This commit is contained in:
parent
7155676618
commit
45f35900c3
1 changed files with 6 additions and 3 deletions
|
|
@ -466,9 +466,11 @@ st_regen_renderbuffer_surface(struct st_context *st,
|
|||
surf_tmpl.u.tex.first_layer = surf->u.tex.first_layer;
|
||||
surf_tmpl.u.tex.last_layer = surf->u.tex.last_layer;
|
||||
|
||||
/* create -> destroy to avoid blowing up cached surfaces */
|
||||
surf = pipe->create_surface(pipe, resource, &surf_tmpl);
|
||||
pipe_surface_release(pipe, psurf);
|
||||
*psurf = surf;
|
||||
|
||||
*psurf = pipe->create_surface(pipe, resource, &surf_tmpl);
|
||||
strb->surface = *psurf;
|
||||
}
|
||||
|
||||
|
|
@ -569,9 +571,10 @@ st_update_renderbuffer_surface(struct st_context *st,
|
|||
surf_tmpl.u.tex.first_layer = first_layer;
|
||||
surf_tmpl.u.tex.last_layer = last_layer;
|
||||
|
||||
/* create -> destroy to avoid blowing up cached surfaces */
|
||||
struct pipe_surface *surf = pipe->create_surface(pipe, resource, &surf_tmpl);
|
||||
pipe_surface_release(pipe, psurf);
|
||||
|
||||
*psurf = pipe->create_surface(pipe, resource, &surf_tmpl);
|
||||
*psurf = surf;
|
||||
}
|
||||
strb->surface = *psurf;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue