From 3a8ad28524bc6c8b8ce31f57cd47ca538614c610 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Tue, 12 Jul 2022 11:21:57 +0300 Subject: [PATCH] anv: skip flush/invalidate faster MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lionel Landwerlin Reviewed-by: Marcin Ĺšlusarz Part-of: --- src/intel/vulkan/anv_device.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 6766840851d..03cbea51f02 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -4199,11 +4199,11 @@ VkResult anv_FlushMappedMemoryRanges( for (uint32_t i = 0; i < memoryRangeCount; i++) { ANV_FROM_HANDLE(anv_device_memory, mem, pMemoryRanges[i].memory); - uint64_t map_offset = pMemoryRanges[i].offset + mem->map_delta; - if (map_offset >= mem->map_size) + if (mem->type->propertyFlags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) continue; - if (mem->type->propertyFlags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) + uint64_t map_offset = pMemoryRanges[i].offset + mem->map_delta; + if (map_offset >= mem->map_size) continue; intel_clflush_range(mem->map + map_offset, @@ -4226,11 +4226,11 @@ VkResult anv_InvalidateMappedMemoryRanges( for (uint32_t i = 0; i < memoryRangeCount; i++) { ANV_FROM_HANDLE(anv_device_memory, mem, pMemoryRanges[i].memory); - uint64_t map_offset = pMemoryRanges[i].offset + mem->map_delta; - if (map_offset >= mem->map_size) + if (mem->type->propertyFlags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) continue; - if (mem->type->propertyFlags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) + uint64_t map_offset = pMemoryRanges[i].offset + mem->map_delta; + if (map_offset >= mem->map_size) continue; intel_invalidate_range(mem->map + map_offset,