mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 11:28:05 +02:00
zink: fix sparse bo placement
the util function here takes a bitmask of memory type indices, not properties.
rename the function and correct the usage
fixes sparse on nvidia blob
Fixes: c71287e70c ("zink: correct sparse bo mem_type_idx placement")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27414>
This commit is contained in:
parent
bb14ee53a5
commit
3b025d6b42
3 changed files with 5 additions and 5 deletions
|
|
@ -548,7 +548,7 @@ bo_sparse_create(struct zink_screen *screen, uint64_t size)
|
|||
bo->base.base.alignment_log2 = util_logbase2(ZINK_SPARSE_BUFFER_PAGE_SIZE);
|
||||
bo->base.base.size = size;
|
||||
bo->base.vtbl = &bo_sparse_vtbl;
|
||||
unsigned placement = zink_mem_type_idx_from_bits(screen, ZINK_HEAP_DEVICE_LOCAL_SPARSE, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT);
|
||||
unsigned placement = zink_mem_type_idx_from_types(screen, ZINK_HEAP_DEVICE_LOCAL_SPARSE, UINT32_MAX);
|
||||
assert(placement != UINT32_MAX);
|
||||
bo->base.base.placement = placement;
|
||||
bo->unique_id = p_atomic_inc_return(&screen->pb.next_bo_unique_id);
|
||||
|
|
|
|||
|
|
@ -94,10 +94,10 @@ zink_heap_from_domain_flags(VkMemoryPropertyFlags domains, enum zink_alloc_flag
|
|||
}
|
||||
|
||||
static ALWAYS_INLINE unsigned
|
||||
zink_mem_type_idx_from_bits(struct zink_screen *screen, enum zink_heap heap, uint32_t bits)
|
||||
zink_mem_type_idx_from_types(struct zink_screen *screen, enum zink_heap heap, uint32_t types)
|
||||
{
|
||||
for (unsigned i = 0; i < screen->heap_count[heap]; i++) {
|
||||
if (bits & BITFIELD_BIT(screen->heap_map[heap][i])) {
|
||||
if (types & BITFIELD_BIT(screen->heap_map[heap][i])) {
|
||||
return screen->heap_map[heap][i];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1033,7 +1033,7 @@ allocate_bo(struct zink_screen *screen, const struct pipe_resource *templ,
|
|||
alignment = MAX2(alignment, screen->info.props.limits.minMemoryMapAlignment);
|
||||
obj->alignment = alignment;
|
||||
|
||||
if (zink_mem_type_idx_from_bits(screen, heap, reqs->memoryTypeBits) == UINT32_MAX) {
|
||||
if (zink_mem_type_idx_from_types(screen, heap, reqs->memoryTypeBits) == UINT32_MAX) {
|
||||
/* not valid based on reqs; demote to more compatible type */
|
||||
switch (heap) {
|
||||
case ZINK_HEAP_DEVICE_LOCAL_VISIBLE:
|
||||
|
|
@ -1045,7 +1045,7 @@ allocate_bo(struct zink_screen *screen, const struct pipe_resource *templ,
|
|||
default:
|
||||
break;
|
||||
}
|
||||
assert(zink_mem_type_idx_from_bits(screen, heap, reqs->memoryTypeBits) != UINT32_MAX);
|
||||
assert(zink_mem_type_idx_from_types(screen, heap, reqs->memoryTypeBits) != UINT32_MAX);
|
||||
}
|
||||
|
||||
while (1) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue