radv: remove unnecessary NULL checks in vkMapMemory()/vkUnmapMemory()

It's required to have a valid device memory handle and it would make
no sense to call these functions with a NULL pointer.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14287>
This commit is contained in:
Samuel Pitoiset
2021-12-15 12:33:07 +01:00
parent ff7aee2ac9
commit 3368e522b4
-8
View File
@@ -5473,11 +5473,6 @@ radv_MapMemory(VkDevice _device, VkDeviceMemory _memory, VkDeviceSize offset, Vk
RADV_FROM_HANDLE(radv_device, device, _device);
RADV_FROM_HANDLE(radv_device_memory, mem, _memory);
if (mem == NULL) {
*ppData = NULL;
return VK_SUCCESS;
}
if (mem->user_ptr)
*ppData = mem->user_ptr;
else
@@ -5497,9 +5492,6 @@ radv_UnmapMemory(VkDevice _device, VkDeviceMemory _memory)
RADV_FROM_HANDLE(radv_device, device, _device);
RADV_FROM_HANDLE(radv_device_memory, mem, _memory);
if (mem == NULL)
return;
if (mem->user_ptr == NULL)
device->ws->buffer_unmap(mem->bo);
}