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>
(cherry picked from commit 0e02de5a50)
This commit is contained in:
Tapani Pälli 2024-09-16 07:53:25 +03:00 committed by Eric Engestrom
parent 2e32cdaf65
commit a0da2bc120
2 changed files with 10 additions and 1 deletions

View file

@ -84,7 +84,7 @@
"description": "iris: fix issues with memory object updates via glBufferSubData",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -2547,6 +2547,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