iris: fix issues with memory object updates via glBufferSubData

Disable aysnc mapping in case we are updating a external memobj.

Fixes following Piglit tests:
   spec@ext_external_objects@vk-pix-buf-update-errors
   spec@ext_external_objects@vk-vert-buf-update-errors

Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29303>
This commit is contained in:
Tapani Pälli 2024-09-16 07:53:25 +03:00 committed by Marge Bot
parent 02b124846f
commit 0e02de5a50

View file

@ -2537,6 +2537,15 @@ iris_transfer_map(struct pipe_context *ctx,
usage |= PIPE_MAP_UNSYNCHRONIZED;
}
/* We are dealing with external memory object PIPE_BUFFER, disable
* async mapping because of sync issues.
*/
if (!res->mod_info &&
res->external_format != PIPE_FORMAT_NONE &&
resource->target == PIPE_BUFFER) {
usage &= ~PIPE_MAP_UNSYNCHRONIZED;
}
/* Avoid using GPU copies for persistent/coherent buffers, as the idea
* there is to access them simultaneously on the CPU & GPU. This also
* avoids trying to use GPU copies for our u_upload_mgr buffers which