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 <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13555>
This commit is contained in:
Nanley Chery 2021-10-19 17:26:34 -07:00 committed by Marge Bot
parent 9acf0316ec
commit 4027337004

View file

@ -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;