vk: Update memory flushing functions to 130
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 8 Jul 2015 00:22:29 +0000 (17:22 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 8 Jul 2015 00:22:31 +0000 (17:22 -0700)
This involves updating the prototype for FlushMappedMemory, adding
InvalidateMappedMemoryRanges, and removing PinSystemMemory.

include/vulkan/vulkan.h
src/vulkan/device.c

index 865c2d5635a810eba3624db9c453c3c3ca4d4164..8cb9827eae23915ccfae7e2cf694321f9ddfba78 100644 (file)
@@ -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,
index ca0d41290a54e64422d6df2f5a910aa2a25cccb4..83c3908b4fd9131c59e112ce21f7bdb4cdd5ce28 100644 (file)
@@ -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(