mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 08:58:02 +02:00
radv: make sure we set buffers as shareable properly.
This should make sure we don't treat exports buffers as local
bos.
Fixes: a639d40f13 (radv: add support for local bos. (v3))
Tested-by: Andres Rodriguez <andresx7@gmail.com>
Reviewed-by: Andres Rodriguez <andresx7@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
6594213cfa
commit
799ef80059
2 changed files with 7 additions and 2 deletions
|
|
@ -2255,13 +2255,13 @@ void radv_GetBufferMemoryRequirements2KHR(
|
|||
{
|
||||
radv_GetBufferMemoryRequirements(device, pInfo->buffer,
|
||||
&pMemoryRequirements->memoryRequirements);
|
||||
|
||||
RADV_FROM_HANDLE(radv_buffer, buffer, pInfo->buffer);
|
||||
vk_foreach_struct(ext, pMemoryRequirements->pNext) {
|
||||
switch (ext->sType) {
|
||||
case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR: {
|
||||
VkMemoryDedicatedRequirementsKHR *req =
|
||||
(VkMemoryDedicatedRequirementsKHR *) ext;
|
||||
req->requiresDedicatedAllocation = false;
|
||||
req->requiresDedicatedAllocation = buffer->shareable;
|
||||
req->prefersDedicatedAllocation = req->requiresDedicatedAllocation;
|
||||
break;
|
||||
}
|
||||
|
|
@ -2775,6 +2775,9 @@ VkResult radv_CreateBuffer(
|
|||
buffer->offset = 0;
|
||||
buffer->flags = pCreateInfo->flags;
|
||||
|
||||
buffer->shareable = vk_find_struct_const(pCreateInfo->pNext,
|
||||
EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR) != NULL;
|
||||
|
||||
if (pCreateInfo->flags & VK_BUFFER_CREATE_SPARSE_BINDING_BIT) {
|
||||
buffer->bo = device->ws->buffer_create(device->ws,
|
||||
align64(buffer->size, 4096),
|
||||
|
|
|
|||
|
|
@ -673,6 +673,8 @@ struct radv_buffer {
|
|||
/* Set when bound */
|
||||
struct radeon_winsys_bo * bo;
|
||||
VkDeviceSize offset;
|
||||
|
||||
bool shareable;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue