zink: only report device-local memory as video-memory

While the definition of "video memory" isn't super clear, I think it's
pretty reasonable to assume host-memory isn't meant to be included. So
let's only count dedicated memory here.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3107
Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
Tested-by: Witold Baryluk <witold.baryluk@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5409>
This commit is contained in:
Erik Faye-Lund 2020-06-09 21:54:23 +02:00 committed by Marge Bot
parent 9b58c4958b
commit 10f07495f6

View file

@ -80,8 +80,11 @@ static int
get_video_mem(struct zink_screen *screen)
{
VkDeviceSize size = 0;
for (uint32_t i = 0; i < screen->mem_props.memoryHeapCount; ++i)
size += screen->mem_props.memoryHeaps[i].size;
for (uint32_t i = 0; i < screen->mem_props.memoryHeapCount; ++i) {
if (screen->mem_props.memoryHeaps[i].flags &
VK_MEMORY_HEAP_DEVICE_LOCAL_BIT)
size += screen->mem_props.memoryHeaps[i].size;
}
return (int)(size >> 20);
}