zink: fix memory availability reporting

this shouldn't report the budgeted available memory, it should return
the total memory, as that's what this api expects

Fixes: ff4ba3d4a7 ("zink: support PIPE_CAP_QUERY_MEMORY_INFO")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13849>
This commit is contained in:
Mike Blumenkrantz
2021-11-17 16:48:28 -05:00
committed by Marge Bot
parent 5f140a723d
commit 72a88c77de

View File

@@ -1746,11 +1746,11 @@ zink_query_memory_info(struct pipe_screen *pscreen, struct pipe_memory_info *inf
if (mem.memoryProperties.memoryHeaps[i].flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) {
/* VRAM */
info->total_device_memory += mem.memoryProperties.memoryHeaps[i].size / 1024;
info->avail_device_memory += (budget.heapBudget[i] - budget.heapUsage[i]) / 1024;
info->avail_device_memory += (mem.memoryProperties.memoryHeaps[i].size - budget.heapUsage[i]) / 1024;
} else {
/* GART */
info->total_staging_memory += mem.memoryProperties.memoryHeaps[i].size / 1024;
info->avail_staging_memory += (budget.heapBudget[i] - budget.heapUsage[i]) / 1024;
info->avail_staging_memory += (mem.memoryProperties.memoryHeaps[i].size - budget.heapUsage[i]) / 1024;
}
}
/* evictions not yet supported in vulkan */