mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
zink: always set VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT for usermem
required by spec backport-to: 23.3 Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25914>
This commit is contained in:
parent
7035b5a8e8
commit
009d4a5fda
1 changed files with 13 additions and 0 deletions
|
|
@ -848,6 +848,14 @@ resource_object_create(struct zink_screen *screen, const struct pipe_resource *t
|
|||
return obj;
|
||||
} else if (templ->target == PIPE_BUFFER) {
|
||||
VkBufferCreateInfo bci = create_bci(screen, templ, templ->bind);
|
||||
VkExternalMemoryBufferCreateInfo embci;
|
||||
|
||||
if (user_mem) {
|
||||
embci.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO;
|
||||
embci.pNext = bci.pNext;
|
||||
embci.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT;
|
||||
bci.pNext = &embci;
|
||||
}
|
||||
|
||||
if (VKSCR(CreateBuffer)(screen->dev, &bci, NULL, &obj->buffer) != VK_SUCCESS) {
|
||||
mesa_loge("ZINK: vkCreateBuffer failed");
|
||||
|
|
@ -984,6 +992,11 @@ resource_object_create(struct zink_screen *screen, const struct pipe_resource *t
|
|||
} else if (ici.tiling == VK_IMAGE_TILING_OPTIMAL) {
|
||||
shared = false;
|
||||
}
|
||||
} else if (user_mem) {
|
||||
emici.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO;
|
||||
emici.pNext = ici.pNext;
|
||||
emici.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT;
|
||||
ici.pNext = &emici;
|
||||
}
|
||||
|
||||
if (linear)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue