mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 00:10:10 +01:00
zink: rebind resources for export as needed
exporting all resources breaks suballocation, so instead just use the existing heuristics and then forcibly rebind resources as needed for this functionality Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16252>
This commit is contained in:
parent
4a19ebfafc
commit
4eeabb59f5
1 changed files with 9 additions and 0 deletions
|
|
@ -1193,6 +1193,15 @@ zink_resource_get_handle(struct pipe_screen *pscreen,
|
||||||
if (whandle->type == WINSYS_HANDLE_TYPE_KMS) {
|
if (whandle->type == WINSYS_HANDLE_TYPE_KMS) {
|
||||||
whandle->handle = -1;
|
whandle->handle = -1;
|
||||||
} else {
|
} else {
|
||||||
|
if (!res->obj->exportable) {
|
||||||
|
assert(!res->all_binds); //TODO handle if problematic
|
||||||
|
assert(!zink_resource_usage_is_unflushed(res));
|
||||||
|
if (!add_resource_bind(screen->copy_context, res, ZINK_BIND_DMABUF | PIPE_BIND_SHARED))
|
||||||
|
return false;
|
||||||
|
screen->copy_context->base.flush(&screen->copy_context->base, NULL, 0);
|
||||||
|
obj = res->obj;
|
||||||
|
}
|
||||||
|
|
||||||
VkMemoryGetFdInfoKHR fd_info = {0};
|
VkMemoryGetFdInfoKHR fd_info = {0};
|
||||||
int fd;
|
int fd;
|
||||||
fd_info.sType = VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR;
|
fd_info.sType = VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue