mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 21:50:12 +01:00
anv: prevent trying to mmap non host visible memory
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Ivan Briano <ivan.briano@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17873>
This commit is contained in:
parent
b08f293686
commit
a254aff643
1 changed files with 10 additions and 0 deletions
|
|
@ -4171,6 +4171,16 @@ VkResult anv_MapMemory(
|
|||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
/* From the Vulkan spec version 1.0.32 docs for MapMemory:
|
||||
*
|
||||
* * memory must have been created with a memory type that reports
|
||||
* VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT
|
||||
*/
|
||||
if (!(mem->type->propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)) {
|
||||
return vk_errorf(device, VK_ERROR_MEMORY_MAP_FAILED,
|
||||
"Memory object not mappable.");
|
||||
}
|
||||
|
||||
if (size == VK_WHOLE_SIZE)
|
||||
size = mem->bo->size - offset;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue