From: Jason Ekstrand Date: Wed, 8 Jul 2015 00:22:29 +0000 (-0700) Subject: vk: Update memory flushing functions to 130 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d9c2caea6ae6538095196b590f7eec8da1aa1fea;p=mesa.git vk: Update memory flushing functions to 130 This involves updating the prototype for FlushMappedMemory, adding InvalidateMappedMemoryRanges, and removing PinSystemMemory. --- diff --git a/include/vulkan/vulkan.h b/include/vulkan/vulkan.h index 865c2d5635a..8cb9827eae2 100644 --- a/include/vulkan/vulkan.h +++ b/include/vulkan/vulkan.h @@ -1236,6 +1236,14 @@ typedef struct { VkMemoryPropertyFlags memProps; } VkMemoryAllocInfo; +typedef struct { + VkStructureType sType; + const void* pNext; + VkDeviceMemory mem; + VkDeviceSize offset; + VkDeviceSize size; +} VkMappedMemoryRange; + typedef struct { VkDeviceSize size; VkDeviceSize alignment; @@ -1919,8 +1927,8 @@ typedef VkResult (VKAPI *PFN_vkAllocMemory)(VkDevice device, const VkMemoryAlloc typedef VkResult (VKAPI *PFN_vkFreeMemory)(VkDevice device, VkDeviceMemory mem); typedef VkResult (VKAPI *PFN_vkMapMemory)(VkDevice device, VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void** ppData); typedef VkResult (VKAPI *PFN_vkUnmapMemory)(VkDevice device, VkDeviceMemory mem); -typedef VkResult (VKAPI *PFN_vkFlushMappedMemory)(VkDevice device, VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size); -typedef VkResult (VKAPI *PFN_vkPinSystemMemory)(VkDevice device, const void* pSysMem, size_t memSize, VkDeviceMemory* pMem); +typedef VkResult (VKAPI *PFN_vkFlushMappedMemoryRanges)(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges); +typedef VkResult (VKAPI *PFN_vkInvalidateMappedMemoryRanges)(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges); typedef VkResult (VKAPI *PFN_vkDestroyObject)(VkDevice device, VkObjectType objType, VkObject object); typedef VkResult (VKAPI *PFN_vkGetObjectInfo)(VkDevice device, VkObjectType objType, VkObject object, VkObjectInfoType infoType, size_t* pDataSize, void* pData); typedef VkResult (VKAPI *PFN_vkQueueBindObjectMemory)(VkQueue queue, VkObjectType objType, VkObject object, uint32_t allocationIdx, VkDeviceMemory mem, VkDeviceSize offset); @@ -2099,17 +2107,15 @@ VkResult VKAPI vkUnmapMemory( VkDevice device, VkDeviceMemory mem); -VkResult VKAPI vkFlushMappedMemory( +VkResult VKAPI vkFlushMappedMemoryRanges( VkDevice device, - VkDeviceMemory mem, - VkDeviceSize offset, - VkDeviceSize size); + uint32_t memRangeCount, + const VkMappedMemoryRange* pMemRanges); -VkResult VKAPI vkPinSystemMemory( +VkResult VKAPI vkInvalidateMappedMemoryRanges( VkDevice device, - const void* pSysMem, - size_t memSize, - VkDeviceMemory* pMem); + uint32_t memRangeCount, + const VkMappedMemoryRange* pMemRanges); VkResult VKAPI vkDestroyObject( VkDevice device, diff --git a/src/vulkan/device.c b/src/vulkan/device.c index ca0d41290a5..83c3908b4fd 100644 --- a/src/vulkan/device.c +++ b/src/vulkan/device.c @@ -990,24 +990,22 @@ VkResult anv_UnmapMemory( return VK_SUCCESS; } -VkResult anv_FlushMappedMemory( +VkResult anv_FlushMappedMemoryRanges( VkDevice device, - VkDeviceMemory mem, - VkDeviceSize offset, - VkDeviceSize size) + uint32_t memRangeCount, + const VkMappedMemoryRange* pMemRanges) { /* clflush here for !llc platforms */ return VK_SUCCESS; } -VkResult anv_PinSystemMemory( +VkResult anv_InvalidateMappedMemoryRanges( VkDevice device, - const void* pSysMem, - size_t memSize, - VkDeviceMemory* pMem) + uint32_t memRangeCount, + const VkMappedMemoryRange* pMemRanges) { - return VK_SUCCESS; + return anv_FlushMappedMemoryRanges(device, memRangeCount, pMemRanges); } VkResult anv_DestroyObject(