Mesa (main): zink: simplify else clause for mem info gathering
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Aug 4 19:19:38 UTC 2021
Module: Mesa
Branch: main
Commit: c886ce2991a5b6fec054810d0c891d599986593c
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c886ce2991a5b6fec054810d0c891d599986593c
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date: Wed Aug 4 12:05:04 2021 -0400
zink: simplify else clause for mem info gathering
it doesn't matter if this is host-visible, it just has to not be device-local
Fixes: 73f6bff07f1 ("zink: fix mem info query to be more permissive")
Reviewed-by: Hoe Hao Cheng <haochengho12907 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12199>
---
src/gallium/drivers/zink/zink_screen.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c
index 8a86828244b..16a68195cf7 100644
--- a/src/gallium/drivers/zink/zink_screen.c
+++ b/src/gallium/drivers/zink/zink_screen.c
@@ -1652,7 +1652,7 @@ zink_query_memory_info(struct pipe_screen *pscreen, struct pipe_memory_info *inf
/* VRAM */
info->total_device_memory += mem.memoryProperties.memoryHeaps[i].size / 1024;
info->avail_device_memory += (budget.heapBudget[i] - budget.heapUsage[i]) / 1024;
- } else if (mem.memoryProperties.memoryHeaps[i].flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) {
+ } else {
/* GART */
info->total_staging_memory += mem.memoryProperties.memoryHeaps[i].size / 1024;
info->avail_staging_memory += (budget.heapBudget[i] - budget.heapUsage[i]) / 1024;
@@ -1666,7 +1666,7 @@ zink_query_memory_info(struct pipe_screen *pscreen, struct pipe_memory_info *inf
info->total_device_memory += screen->info.mem_props.memoryHeaps[i].size / 1024;
/* free real estate! */
info->avail_device_memory += info->total_device_memory;
- } else if (screen->info.mem_props.memoryHeaps[i].flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) {
+ } else {
/* GART */
info->total_staging_memory += screen->info.mem_props.memoryHeaps[i].size / 1024;
/* free real estate! */
More information about the mesa-commit
mailing list