mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 22:10:10 +01:00
gallium/util: make util_copy_framebuffer_state(src=NULL) work
Be more consistent with the other u_inlines util_copy_xyz_state() helpers and support NULL src. Signed-off-by: Rob Clark <robclark@freedesktop.org> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
parent
660cd3de4a
commit
def044376a
1 changed files with 26 additions and 11 deletions
|
|
@ -86,6 +86,7 @@ util_copy_framebuffer_state(struct pipe_framebuffer_state *dst,
|
|||
{
|
||||
unsigned i;
|
||||
|
||||
if (src) {
|
||||
dst->width = src->width;
|
||||
dst->height = src->height;
|
||||
|
||||
|
|
@ -102,6 +103,20 @@ util_copy_framebuffer_state(struct pipe_framebuffer_state *dst,
|
|||
dst->nr_cbufs = src->nr_cbufs;
|
||||
|
||||
pipe_surface_reference(&dst->zsbuf, src->zsbuf);
|
||||
} else {
|
||||
dst->width = 0;
|
||||
dst->height = 0;
|
||||
|
||||
dst->samples = 0;
|
||||
dst->layers = 0;
|
||||
|
||||
for (i = 0 ; i < ARRAY_SIZE(dst->cbufs); i++)
|
||||
pipe_surface_reference(&dst->cbufs[i], NULL);
|
||||
|
||||
dst->nr_cbufs = 0;
|
||||
|
||||
pipe_surface_reference(&dst->zsbuf, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue