mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-07 16:38:33 +02:00
clients/simple-dmabuf-vulkan.c: fix find_memory_type()
Same as simple-vulkan.c. Signed-off-by: Hiroaki Yamamoto <hrak1529@gmail.com>
This commit is contained in:
parent
ae25e544c4
commit
ab1fa93abd
1 changed files with 5 additions and 2 deletions
|
|
@ -459,8 +459,11 @@ find_memory_type(struct display *display, uint32_t allowed, VkMemoryPropertyFlag
|
|||
VkPhysicalDeviceMemoryProperties mem_properties;
|
||||
vkGetPhysicalDeviceMemoryProperties(display->vk.phys_dev, &mem_properties);
|
||||
|
||||
for (unsigned i = 0; (1u << i) <= allowed && i <= mem_properties.memoryTypeCount; ++i) {
|
||||
if ((allowed & (1u << i)) && (mem_properties.memoryTypes[i].propertyFlags & properties))
|
||||
for (unsigned i = 0; i < mem_properties.memoryTypeCount; ++i) {
|
||||
bool is_allowed = allowed & (1u << i);
|
||||
bool has_properties =
|
||||
(mem_properties.memoryTypes[i].propertyFlags & properties) == properties;
|
||||
if (is_allowed && has_properties)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue