From 4027337004e900b3b98cc4ca7e44b60322dca891 Mon Sep 17 00:00:00 2001 From: Nanley Chery Date: Tue, 19 Oct 2021 17:26:34 -0700 Subject: [PATCH] iris: Move some BO setup to iris_resource_init_aux_buf To ease verification, place the assignment and reference of the aux BO right before the same operations are done for the clear color BO. Also, move the call to map_aux_addresses that's in the same if-block. Reviewed-by: Jordan Justen Part-of: --- src/gallium/drivers/iris/iris_resource.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c index 3e51ecde0d2..70ecec17855 100644 --- a/src/gallium/drivers/iris/iris_resource.c +++ b/src/gallium/drivers/iris/iris_resource.c @@ -877,6 +877,12 @@ iris_resource_init_aux_buf(struct iris_screen *screen, iris_bo_unmap(res->bo); + if (res->aux.surf.size_B > 0) { + res->aux.bo = res->bo; + iris_bo_reference(res->aux.bo); + map_aux_addresses(screen, res, res->surf.format, 0); + } + if (iris_get_aux_clear_color_state_size(screen) > 0) { res->aux.clear_color_bo = res->bo; iris_bo_reference(res->aux.clear_color_bo); @@ -1113,12 +1119,6 @@ iris_resource_create_with_modifiers(struct pipe_screen *pscreen, !iris_resource_init_aux_buf(screen, res)) goto fail; - if (res->aux.surf.size_B > 0) { - res->aux.bo = res->bo; - iris_bo_reference(res->aux.bo); - map_aux_addresses(screen, res, res->surf.format, 0); - } - if (templ->bind & PIPE_BIND_SHARED) { iris_bo_mark_exported(res->bo); res->base.is_shared = true;