zink: fix zink_mem_type_idx_from_bits()

at some point this used to work, but it no longer does what it's supposed
to do, which is return a memtype from a heap+flags

Fixes: d702a503ad ("zink: support multiple heaps per memory type")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21025>
This commit is contained in:
Mike Blumenkrantz 2023-01-31 16:46:51 -05:00 committed by Marge Bot
parent ff5a761232
commit d23b3a1394

View file

@ -96,7 +96,7 @@ static inline unsigned
zink_mem_type_idx_from_bits(struct zink_screen *screen, enum zink_heap heap, uint32_t bits)
{
for (unsigned i = 0; i < screen->heap_count[heap]; i++) {
if (bits & BITFIELD_BIT(screen->heap_map[heap][i])) {
if (bits & screen->info.mem_props.memoryTypes[screen->heap_map[heap][i]].propertyFlags) {
return screen->heap_map[heap][i];
}
}