mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 09:20:13 +01:00
zink: avoid cached memory allocations when not requested
don't rely on driver orderings to not pick this Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9981>
This commit is contained in:
parent
0799312b99
commit
d4e2493639
1 changed files with 8 additions and 2 deletions
|
|
@ -172,14 +172,20 @@ get_memory_type_index(struct zink_screen *screen,
|
|||
const VkMemoryRequirements *reqs,
|
||||
VkMemoryPropertyFlags props)
|
||||
{
|
||||
int32_t idx = -1;
|
||||
for (uint32_t i = 0u; i < VK_MAX_MEMORY_TYPES; i++) {
|
||||
if (((reqs->memoryTypeBits >> i) & 1) == 1) {
|
||||
if ((screen->info.mem_props.memoryTypes[i].propertyFlags & props) == props) {
|
||||
return i;
|
||||
break;
|
||||
if (!(props & VK_MEMORY_PROPERTY_HOST_CACHED_BIT) &&
|
||||
screen->info.mem_props.memoryTypes[i].propertyFlags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT) {
|
||||
idx = i;
|
||||
} else
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (idx >= 0)
|
||||
return idx;
|
||||
|
||||
unreachable("Unsupported memory-type");
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue