mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 08:58:02 +02:00
zink: store and reuse memory heap flags for buffer placement
the flags in vk_domain_from_heap() are the MINIMUM required flags for
the heap, but there may be other flags present, so ensure those are picked
up as expected
cc: mesa-stable
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17093>
(cherry picked from commit d63e04e583)
This commit is contained in:
parent
d7b5c1f998
commit
e94120e794
4 changed files with 4 additions and 2 deletions
|
|
@ -85,7 +85,7 @@
|
|||
"description": "zink: store and reuse memory heap flags for buffer placement",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -290,7 +290,7 @@ demote:
|
|||
bo->base.alignment_log2 = util_logbase2(alignment);
|
||||
bo->base.size = mai.allocationSize;
|
||||
bo->base.vtbl = &bo_vtbl;
|
||||
bo->base.placement = vk_domain_from_heap(heap);
|
||||
bo->base.placement = screen->heap_flags[heap];
|
||||
bo->base.usage = flags;
|
||||
bo->unique_id = p_atomic_inc_return(&screen->pb.next_bo_unique_id);
|
||||
|
||||
|
|
|
|||
|
|
@ -2328,6 +2328,7 @@ zink_internal_create_screen(const struct pipe_screen_config *config)
|
|||
else
|
||||
screen->heap_map[i] = screen->heap_map[ZINK_HEAP_DEVICE_LOCAL];
|
||||
}
|
||||
screen->heap_flags[i] = screen->info.mem_props.memoryTypes[screen->heap_map[i]].propertyFlags;
|
||||
}
|
||||
{
|
||||
unsigned vis_vram = screen->heap_map[ZINK_HEAP_DEVICE_LOCAL_VISIBLE];
|
||||
|
|
|
|||
|
|
@ -116,6 +116,7 @@ struct zink_screen {
|
|||
uint32_t next_bo_unique_id;
|
||||
} pb;
|
||||
uint8_t heap_map[VK_MAX_MEMORY_TYPES];
|
||||
VkMemoryPropertyFlags heap_flags[VK_MAX_MEMORY_TYPES];
|
||||
bool resizable_bar;
|
||||
|
||||
uint64_t total_video_mem;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue