mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-20 02:20:22 +01:00
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:
parent
9b58c4958b
commit
10f07495f6
1 changed files with 5 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue