mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-20 05:50:27 +01:00
zink: guard rebar check against fallback heap detection
if there is no heap with device-local and host-visible, then rebar cannot exist. the previous detection did not account for the rebar heap using the device-local fallback, which of course would have the same size as the device-local heap and pass the threshold check cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33359>
This commit is contained in:
parent
8aae760144
commit
3064bfc312
1 changed files with 5 additions and 1 deletions
|
|
@ -3412,6 +3412,8 @@ zink_internal_create_screen(const struct pipe_screen_config *config, int64_t dev
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool maybe_has_rebar = true;
|
||||
/* iterate again to check for missing heaps */
|
||||
for (enum zink_heap i = 0; i < ZINK_HEAP_MAX; i++) {
|
||||
/* not found: use compatible heap */
|
||||
|
|
@ -3425,10 +3427,12 @@ zink_internal_create_screen(const struct pipe_screen_config *config, int64_t dev
|
|||
} else {
|
||||
memcpy(screen->heap_map[i], screen->heap_map[ZINK_HEAP_DEVICE_LOCAL], screen->heap_count[ZINK_HEAP_DEVICE_LOCAL]);
|
||||
screen->heap_count[i] = screen->heap_count[ZINK_HEAP_DEVICE_LOCAL];
|
||||
if (i == ZINK_HEAP_DEVICE_LOCAL_VISIBLE)
|
||||
maybe_has_rebar = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
if (maybe_has_rebar) {
|
||||
uint64_t biggest_vis_vram = 0;
|
||||
for (unsigned i = 0; i < screen->heap_count[ZINK_HEAP_DEVICE_LOCAL_VISIBLE]; i++)
|
||||
biggest_vis_vram = MAX2(biggest_vis_vram, screen->info.mem_props.memoryHeaps[screen->info.mem_props.memoryTypes[screen->heap_map[ZINK_HEAP_DEVICE_LOCAL_VISIBLE][i]].heapIndex].size);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue