vulkan.h: V93 -- fine-grained memory binding synchronization. Bug# 13464
authorMark Lobodzinski <mark@lunarg.com>
Mon, 11 May 2015 22:21:15 +0000 (17:21 -0500)
committerMark Lobodzinski <mark@lunarg.com>
Mon, 11 May 2015 22:21:15 +0000 (17:21 -0500)
New names and behavior for QueueBind* APIs.

13 files changed:
demos/cube.c
demos/tri.c
icd/nulldrv/nulldrv.c
include/vkLayer.h
include/vulkan.h
layers/mem_tracker.cpp
layers/param_checker.cpp
loader/gpa_helper.h
loader/table_ops.h
loader/trampoline.c
loader/vulkan.def
vk-layer-generate.py
vulkan.py

index e9ea59230afb8b8339d7cada3d6cac7bdf9f008b..35789ab64ba84deb420fd4e2ec94c0d13894037b 100644 (file)
@@ -699,7 +699,7 @@ static void demo_prepare_depth(struct demo *demo)
         assert(!err);
 
         /* bind memory */
-        err = vkQueueBindObjectMemory(demo->queue,
+        err = vkBindObjectMemory(demo->device,
                 VK_OBJECT_TYPE_IMAGE, demo->depth.image,
                 i, demo->depth.mem[i], 0);
         assert(!err);
@@ -942,7 +942,7 @@ static void demo_prepare_texture_image(struct demo *demo,
         assert(!err);
 
         /* bind memory */
-        err = vkQueueBindObjectMemory(demo->queue,
+        err = vkBindObjectMemory(demo->device,
                 VK_OBJECT_TYPE_IMAGE, tex_obj->image,
                 j, tex_obj->mem[j], 0);
         assert(!err);
@@ -991,7 +991,7 @@ static void demo_destroy_texture_image(struct demo *demo, struct texture_object
 {
     /* clean up staging resources */
     for (uint32_t j = 0; j < tex_objs->num_mem; j ++) {
-        vkQueueBindObjectMemory(demo->queue,
+        vkBindObjectMemory(demo->device,
                 VK_OBJECT_TYPE_IMAGE, tex_objs->image, j, VK_NULL_HANDLE, 0);
         vkFreeMemory(demo->device, tex_objs->mem[j]);
     }
@@ -1179,7 +1179,7 @@ void demo_prepare_cube_data_buffer(struct demo *demo)
         err = vkUnmapMemory(demo->device, demo->uniform_data.mem[i]);
         assert(!err);
 
-        err = vkQueueBindObjectMemory(demo->queue,
+        err = vkBindObjectMemory(demo->device,
                 VK_OBJECT_TYPE_BUFFER, demo->uniform_data.buf,
                 i, demo->uniform_data.mem[i], 0);
         assert(!err);
@@ -1953,10 +1953,9 @@ static void demo_init_vk(struct demo *demo)
 
     // Graphics queue and MemMgr queue can be separate.
     // TODO: Add support for separate queues, including synchronization,
-    //       and appropriate tracking for QueueSubmit and QueueBindObjectMemory
+    //       and appropriate tracking for QueueSubmit
     for (i = 0; i < queue_count; i++) {
-        if ((demo->queue_props[i].queueFlags & VK_QUEUE_GRAPHICS_BIT) &&
-            (demo->queue_props[i].queueFlags & VK_QUEUE_MEMMGR_BIT)      )
+        if (demo->queue_props[i].queueFlags & VK_QUEUE_GRAPHICS_BIT)
             break;
     }
     assert(i < queue_count);
@@ -2051,7 +2050,7 @@ static void demo_cleanup(struct demo *demo)
 
     for (i = 0; i < DEMO_TEXTURE_COUNT; i++) {
         vkDestroyObject(demo->device, VK_OBJECT_TYPE_IMAGE_VIEW, demo->textures[i].view);
-        vkQueueBindObjectMemory(demo->queue, VK_OBJECT_TYPE_IMAGE, demo->textures[i].image, 0, VK_NULL_HANDLE, 0);
+        vkBindObjectMemory(demo->device, VK_OBJECT_TYPE_IMAGE, demo->textures[i].image, 0, VK_NULL_HANDLE, 0);
         vkDestroyObject(demo->device, VK_OBJECT_TYPE_IMAGE, demo->textures[i].image);
         for (j = 0; j < demo->textures[i].num_mem; j++)
             vkFreeMemory(demo->device, demo->textures[i].mem[j]);
@@ -2061,14 +2060,14 @@ static void demo_cleanup(struct demo *demo)
     vkDestroySwapChainWSI(demo->swap_chain);
 
     vkDestroyObject(demo->device, VK_OBJECT_TYPE_DEPTH_STENCIL_VIEW, demo->depth.view);
-    vkQueueBindObjectMemory(demo->queue, VK_OBJECT_TYPE_IMAGE, demo->depth.image, 0, VK_NULL_HANDLE, 0);
+    vkBindObjectMemory(demo->device, VK_OBJECT_TYPE_IMAGE, demo->depth.image, 0, VK_NULL_HANDLE, 0);
     vkDestroyObject(demo->device, VK_OBJECT_TYPE_IMAGE, demo->depth.image);
     for (j = 0; j < demo->depth.num_mem; j++) {
         vkFreeMemory(demo->device, demo->depth.mem[j]);
     }
 
     vkDestroyObject(demo->device, VK_OBJECT_TYPE_BUFFER_VIEW, demo->uniform_data.view);
-    vkQueueBindObjectMemory(demo->queue, VK_OBJECT_TYPE_BUFFER, demo->uniform_data.buf, 0, VK_NULL_HANDLE, 0);
+    vkBindObjectMemory(demo->device, VK_OBJECT_TYPE_BUFFER, demo->uniform_data.buf, 0, VK_NULL_HANDLE, 0);
     vkDestroyObject(demo->device, VK_OBJECT_TYPE_BUFFER, demo->uniform_data.buf);
     for (j = 0; j < demo->uniform_data.num_mem; j++)
         vkFreeMemory(demo->device, demo->uniform_data.mem[j]);
index 58d19a24e05b64cf27fc41b2a4578ef89c080e43..625036b8c9f5feb0fbb4cce2f4d2af82e068ecc0 100644 (file)
@@ -497,7 +497,7 @@ static void demo_prepare_depth(struct demo *demo)
         assert(!err);
 
         /* bind memory */
-        err = vkQueueBindObjectMemory(demo->queue,
+        err = vkBindObjectMemory(demo->device,
                 VK_OBJECT_TYPE_IMAGE, demo->depth.image,
                 i, demo->depth.mem[i], 0);
         assert(!err);
@@ -580,7 +580,7 @@ static void demo_prepare_texture_image(struct demo *demo,
         assert(!err);
 
         /* bind memory */
-        err = vkQueueBindObjectMemory(demo->queue,
+        err = vkBindObjectMemory(demo->device,
                 VK_OBJECT_TYPE_IMAGE, tex_obj->image,
                 j, tex_obj->mem[j], 0);
         assert(!err);
@@ -632,7 +632,7 @@ static void demo_destroy_texture_image(struct demo *demo, struct texture_object
 {
     /* clean up staging resources */
     for (uint32_t j = 0; j < tex_obj->num_mem; j ++) {
-        vkQueueBindObjectMemory(demo->queue,
+        vkBindObjectMemory(demo->device,
                 VK_OBJECT_TYPE_IMAGE, tex_obj->image, j, VK_NULL_HANDLE, 0);
         vkFreeMemory(demo->device, tex_obj->mem[j]);
     }
@@ -811,7 +811,7 @@ static void demo_prepare_vertices(struct demo *demo)
         err = vkUnmapMemory(demo->device, demo->vertices.mem[i]);
         assert(!err);
 
-        err = vkQueueBindObjectMemory(demo->queue,
+        err = vkBindObjectMemory(demo->device,
                 VK_OBJECT_TYPE_BUFFER, demo->vertices.buf,
                 i, demo->vertices.mem[i], 0);
         assert(!err);
@@ -1453,8 +1453,6 @@ static void demo_init_vk(struct demo *demo)
     for (i = 0; i < queue_count; i++) {
         if (demo->queue_props[i].queueFlags & VK_QUEUE_GRAPHICS_BIT)
             break;
-        if (demo->queue_props[i].queueFlags & VK_QUEUE_MEMMGR_BIT)
-            break;
     }
     assert(i < queue_count);
     demo->graphics_queue_node_index = i;
@@ -1549,14 +1547,14 @@ static void demo_cleanup(struct demo *demo)
     vkDestroyObject(demo->device, VK_OBJECT_TYPE_PIPELINE_LAYOUT, demo->pipeline_layout);
     vkDestroyObject(demo->device, VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT, demo->desc_layout);
 
-    vkQueueBindObjectMemory(demo->queue, VK_OBJECT_TYPE_BUFFER, demo->vertices.buf, 0, VK_NULL_HANDLE, 0);
+    vkBindObjectMemory(demo->device, VK_OBJECT_TYPE_BUFFER, demo->vertices.buf, 0, VK_NULL_HANDLE, 0);
     vkDestroyObject(demo->device, VK_OBJECT_TYPE_BUFFER, demo->vertices.buf);
     for (j = 0; j < demo->vertices.num_mem; j++)
         vkFreeMemory(demo->device, demo->vertices.mem[j]);
 
     for (i = 0; i < DEMO_TEXTURE_COUNT; i++) {
         vkDestroyObject(demo->device, VK_OBJECT_TYPE_IMAGE_VIEW, demo->textures[i].view);
-        vkQueueBindObjectMemory(demo->queue, VK_OBJECT_TYPE_IMAGE, demo->textures[i].image, 0, VK_NULL_HANDLE, 0);
+        vkBindObjectMemory(demo->device, VK_OBJECT_TYPE_IMAGE, demo->textures[i].image, 0, VK_NULL_HANDLE, 0);
         vkDestroyObject(demo->device, VK_OBJECT_TYPE_IMAGE, demo->textures[i].image);
         for (j = 0; j < demo->textures[i].num_mem; j++)
             vkFreeMemory(demo->device, demo->textures[i].mem[j]);
@@ -1565,7 +1563,7 @@ static void demo_cleanup(struct demo *demo)
     }
 
     vkDestroyObject(demo->device, VK_OBJECT_TYPE_DEPTH_STENCIL_VIEW, demo->depth.view);
-    vkQueueBindObjectMemory(demo->queue, VK_OBJECT_TYPE_IMAGE, demo->depth.image, 0, VK_NULL_HANDLE, 0);
+    vkBindObjectMemory(demo->device, VK_OBJECT_TYPE_IMAGE, demo->depth.image, 0, VK_NULL_HANDLE, 0);
     vkDestroyObject(demo->device, VK_OBJECT_TYPE_IMAGE, demo->depth.image);
     for (j = 0; j < demo->depth.num_mem; j++) {
         vkFreeMemory(demo->device, demo->depth.mem[j]);
index 408f2caae1d2080ffd8c881b4a89995057e38ab7..d6472c8582498c1974f874c50858ee7a864ec869 100644 (file)
@@ -1517,7 +1517,7 @@ ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceInfo(
         if (pData == NULL) {
             return ret;
         }
-        props->queueFlags = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_MEMMGR_BIT;
+        props->queueFlags = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_SPARSE_MEMMGR_BIT;
         props->queueCount = 1;
         props->maxAtomicCounters = 1;
         props->supportsTimestamps = false;
@@ -1868,8 +1868,8 @@ ICD_EXPORT VkResult VKAPI vkGetObjectInfo(
     return base->get_info(base, infoType, pDataSize, pData);
 }
 
-ICD_EXPORT VkResult VKAPI vkQueueBindObjectMemory(
-    VkQueue                                     queue,
+ICD_EXPORT VkResult VKAPI vkBindObjectMemory(
+    VkDevice                                    device,
     VkObjectType                                objType,
     VkObject                                    object,
     uint32_t                                    allocationIdx,
@@ -1880,10 +1880,9 @@ ICD_EXPORT VkResult VKAPI vkQueueBindObjectMemory(
     return VK_SUCCESS;
 }
 
-ICD_EXPORT VkResult VKAPI vkQueueBindObjectMemoryRange(
+ICD_EXPORT VkResult VKAPI vkQueueBindSparseBufferMemory(
     VkQueue                                     queue,
-    VkObjectType                                objType,
-    VkObject                                    object,
+    VkBuffer                                    buffer,
     uint32_t                                    allocationIdx,
     VkDeviceSize                                rangeOffset,
     VkDeviceSize                                rangeSize,
@@ -1894,7 +1893,7 @@ ICD_EXPORT VkResult VKAPI vkQueueBindObjectMemoryRange(
     return VK_SUCCESS;
 }
 
-ICD_EXPORT VkResult VKAPI vkQueueBindImageMemoryRange(
+ICD_EXPORT VkResult VKAPI vkQueueBindSparseImageMemory(
     VkQueue                                   queue,
     VkImage                                   image,
     uint32_t                                  allocationIdx,
index bd56f03ddc9280b7945683ca6356e2bbb6e2238a..7239ba5588b2323d0e1c35fb0839667985a10146 100644 (file)
@@ -55,9 +55,9 @@ typedef struct VkLayerDispatchTable_
     PFN_vkOpenPeerImage OpenPeerImage;
     PFN_vkDestroyObject DestroyObject;
     PFN_vkGetObjectInfo GetObjectInfo;
-    PFN_vkQueueBindObjectMemory QueueBindObjectMemory;
-    PFN_vkQueueBindObjectMemoryRange QueueBindObjectMemoryRange;
-    PFN_vkQueueBindImageMemoryRange QueueBindImageMemoryRange;
+    PFN_vkBindObjectMemory BindObjectMemory;
+    PFN_vkQueueBindSparseBufferMemory QueueBindSparseBufferMemory;
+    PFN_vkQueueBindSparseImageMemory QueueBindSparseImageMemory;
     PFN_vkCreateFence CreateFence;
     PFN_vkGetFenceStatus GetFenceStatus;
     PFN_vkResetFences ResetFences;
index e85ca9d2ad69c6bbc5dcc81639d8c615e8af7172..8829222faa21660d3c0a825da8d47898600c188f 100644 (file)
@@ -970,7 +970,7 @@ typedef enum VkQueueFlagBits_
     VK_QUEUE_GRAPHICS_BIT                                   = VK_BIT(0),    // Queue supports graphics operations
     VK_QUEUE_COMPUTE_BIT                                    = VK_BIT(1),    // Queue supports compute operations
     VK_QUEUE_DMA_BIT                                        = VK_BIT(2),    // Queue supports DMA operations
-    VK_QUEUE_MEMMGR_BIT                                     = VK_BIT(3),    // Queue supports memory management operations
+    VK_QUEUE_SPARSE_MEMMGR_BIT                              = VK_BIT(3),    // Queue supports sparse resource memory management operations
     VK_QUEUE_EXTENDED_BIT                                   = VK_BIT(30),   // Extended queue
 } VkQueueFlagBits;
 
@@ -1401,7 +1401,7 @@ typedef struct VkMemoryRequirements_
 {
     VkDeviceSize                                size;                       // Specified in bytes
     VkDeviceSize                                alignment;                  // Specified in bytes
-    VkDeviceSize                                granularity;                // Granularity on which vkQueueBindObjectMemoryRange can bind sub-ranges of memory specified in bytes (usually the page size)
+    VkDeviceSize                                granularity;                // Granularity at which memory can be bound to resource sub-ranges specified in bytes (usually the page size)
     VkMemoryPropertyFlags                       memPropsAllowed;            // Allowed memory property flags
     VkMemoryPropertyFlags                       memPropsRequired;           // Required memory property flags
 } VkMemoryRequirements;
@@ -2161,9 +2161,9 @@ typedef VkResult (VKAPI *PFN_vkOpenPeerMemory)(VkDevice device, const VkPeerMemo
 typedef VkResult (VKAPI *PFN_vkOpenPeerImage)(VkDevice device, const VkPeerImageOpenInfo* pOpenInfo, VkImage* pImage, VkDeviceMemory* pMem);
 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);
-typedef VkResult (VKAPI *PFN_vkQueueBindObjectMemoryRange)(VkQueue queue, VkObjectType objType, VkObject object, uint32_t allocationIdx, VkDeviceSize rangeOffset, VkDeviceSize rangeSize, VkDeviceMemory mem, VkDeviceSize memOffset);
-typedef VkResult (VKAPI *PFN_vkQueueBindImageMemoryRange)(VkQueue queue, VkImage image, uint32_t allocationIdx, const VkImageMemoryBindInfo* pBindInfo, VkDeviceMemory mem, VkDeviceSize memOffset);
+typedef VkResult (VKAPI *PFN_vkBindObjectMemory)(VkDevice device, VkObjectType objType, VkObject object, uint32_t allocationIdx, VkDeviceMemory mem, VkDeviceSize offset);
+typedef VkResult (VKAPI *PFN_vkQueueBindSparseBufferMemory)(VkQueue queue, VkBuffer buffer, uint32_t allocationIdx, VkDeviceSize rangeOffset, VkDeviceSize rangeSize, VkDeviceMemory mem, VkDeviceSize memOffset);
+typedef VkResult (VKAPI *PFN_vkQueueBindSparseImageMemory)(VkQueue queue, VkImage image, uint32_t allocationIdx, const VkImageMemoryBindInfo* pBindInfo, VkDeviceMemory mem, VkDeviceSize memOffset);
 typedef VkResult (VKAPI *PFN_vkCreateFence)(VkDevice device, const VkFenceCreateInfo* pCreateInfo, VkFence* pFence);
 typedef VkResult (VKAPI *PFN_vkResetFences)(VkDevice device, uint32_t fenceCount, VkFence* pFences);
 typedef VkResult (VKAPI *PFN_vkGetFenceStatus)(VkDevice device, VkFence fence);
@@ -2420,25 +2420,24 @@ VkResult VKAPI vkGetObjectInfo(
 
 // Memory management API functions
 
-VkResult VKAPI vkQueueBindObjectMemory(
-    VkQueue                                     queue,
+VkResult VKAPI vkBindObjectMemory(
+    VkDevice                                    device,
     VkObjectType                                objType,
     VkObject                                    object,
     uint32_t                                    allocationIdx,
     VkDeviceMemory                              mem,
     VkDeviceSize                                memOffset);
 
-VkResult VKAPI vkQueueBindObjectMemoryRange(
+VkResult VKAPI vkQueueBindSparseBufferMemory(
     VkQueue                                     queue,
-    VkObjectType                                objType,
-    VkObject                                    object,
+    VkBuffer                                    buffer,
     uint32_t                                    allocationIdx,
     VkDeviceSize                                rangeOffset,
     VkDeviceSize                                rangeSize,
     VkDeviceMemory                              mem,
     VkDeviceSize                                memOffset);
 
-VkResult VKAPI vkQueueBindImageMemoryRange(
+VkResult VKAPI vkQueueBindSparseImageMemory(
     VkQueue                                     queue,
     VkImage                                     image,
     uint32_t                                    allocationIdx,
index 98b2df547605ecc833e47dcca7857f3a6466de61..3d3a9965ced88ef599d1267e38358859519ac002 100644 (file)
@@ -1177,7 +1177,7 @@ VK_LAYER_EXPORT VkResult VKAPI vkDestroyObject(
             else {
                 char str[1024];
                 sprintf(str, "Destroying obj %p that is still bound to memory object %p\nYou should first clear binding "
-                             "by calling vkQueueBindObjectMemory(queue, %p, 0, VK_NULL_HANDLE, 0)",
+                             "by calling vkBindObjectMemory(queue, %p, 0, VK_NULL_HANDLE, 0)",
                              object, (void*)pDelInfo->pMemObjInfo->mem, object);
                 layerCbMsg(VK_DBG_MSG_ERROR, VK_VALIDATION_LEVEL_0, object, 0, MEMTRACK_DESTROY_OBJECT_ERROR, "MEM", str);
                 // From the spec : If an object has previous memory binding, it is required to unbind memory
@@ -1203,22 +1203,22 @@ VK_LAYER_EXPORT VkResult VKAPI vkGetObjectInfo(
     void             *pData)
 {
     // TODO : What to track here?
-    //   Could potentially save returned mem requirements and validate values passed into QueueBindObjectMemory for this object
+    //   Could potentially save returned mem requirements and validate values passed into BindObjectMemory for this object
     // From spec : The only objects that are guaranteed to have no external memory requirements are devices, queues,
     //             command buffers, shaders and memory objects.
     VkResult result = nextTable.GetObjectInfo(device, objType, object, infoType, pDataSize, pData);
     return result;
 }
 
-VK_LAYER_EXPORT VkResult VKAPI vkQueueBindObjectMemory(
-    VkQueue        queue,
+VK_LAYER_EXPORT VkResult VKAPI vkBindObjectMemory(
+    VkDevice       device,
     VkObjectType   objType,
     VkObject       object,
     uint32_t       allocationIdx,
     VkDeviceMemory mem,
     VkDeviceSize   offset)
 {
-    VkResult result = nextTable.QueueBindObjectMemory(queue, objType, object, allocationIdx, mem, offset);
+    VkResult result = nextTable.BindObjectMemory(device, objType, object, allocationIdx, mem, offset);
     loader_platform_thread_lock_mutex(&globalLock);
     // Track objects tied to memory
     if (VK_FALSE == updateObjectBinding(object, mem)) {
@@ -1232,23 +1232,22 @@ VK_LAYER_EXPORT VkResult VKAPI vkQueueBindObjectMemory(
     return result;
 }
 
-VK_LAYER_EXPORT VkResult VKAPI vkQueueBindObjectMemoryRange(
+VK_LAYER_EXPORT VkResult VKAPI vkQueueBindSparseBufferMemory(
     VkQueue        queue,
-    VkObjectType   objType,
-    VkObject       object,
+    VkBuffer       buffer,
     uint32_t       allocationIdx,
     VkDeviceSize   rangeOffset,
     VkDeviceSize   rangeSize,
     VkDeviceMemory mem,
     VkDeviceSize   memOffset)
 {
-    VkResult result = nextTable.QueueBindObjectMemoryRange(queue, objType, object, allocationIdx, rangeOffset, rangeSize, mem, memOffset);
+    VkResult result = nextTable.QueueBindSparseBufferMemory(queue, buffer, allocationIdx, rangeOffset, rangeSize, mem, memOffset);
     loader_platform_thread_lock_mutex(&globalLock);
     // Track objects tied to memory
-    if (VK_FALSE == updateObjectBinding(object, mem)) {
+    if (VK_FALSE == updateObjectBinding(buffer, mem)) {
         char str[1024];
-        sprintf(str, "Unable to set object %p binding to mem obj %p", (void*)object, (void*)mem);
-        layerCbMsg(VK_DBG_MSG_ERROR, VK_VALIDATION_LEVEL_0, object, 0, MEMTRACK_MEMORY_BINDING_ERROR, "MEM", str);
+        sprintf(str, "Unable to set object %p binding to mem obj %p", (void*)buffer, (void*)mem);
+        layerCbMsg(VK_DBG_MSG_ERROR, VK_VALIDATION_LEVEL_0, buffer, 0, MEMTRACK_MEMORY_BINDING_ERROR, "MEM", str);
     }
     printObjList();
     printMemList();
@@ -2245,10 +2244,10 @@ VK_LAYER_EXPORT void* VKAPI vkGetProcAddr(
         return (void*) vkDestroyObject;
     if (!strcmp(funcName, "vkGetObjectInfo"))
         return (void*) vkGetObjectInfo;
-    if (!strcmp(funcName, "vkQueueBindObjectMemory"))
-        return (void*) vkQueueBindObjectMemory;
-    if (!strcmp(funcName, "vkQueueBindObjectMemoryRange"))
-        return (void*) vkQueueBindObjectMemoryRange;
+    if (!strcmp(funcName, "vkBindObjectMemory"))
+        return (void*) vkBindObjectMemory;
+    if (!strcmp(funcName, "vkQueueBindSparseBufferMemory"))
+        return (void*) vkQueueBindSparseBufferMemory;
     if (!strcmp(funcName, "vkCreateFence"))
         return (void*) vkCreateFence;
     if (!strcmp(funcName, "vkGetFenceStatus"))
index 79783cb524ca3e95219fd8256846efddc53e7f5c..e9e8bb9f3f4fdc5aea6771f76ba3d1bb87257e36 100644 (file)
@@ -516,32 +516,32 @@ VK_LAYER_EXPORT VkResult VKAPI vkGetObjectInfo(VkDevice device, VkObjectType obj
     return result;
 }
 
-VK_LAYER_EXPORT VkResult VKAPI vkQueueBindObjectMemory(VkQueue queue, VkObjectType objType, VkObject object, uint32_t allocationIdx, VkDeviceMemory mem, VkDeviceSize offset)
+VK_LAYER_EXPORT VkResult VKAPI vkBindObjectMemory(VkDevice device, VkObjectType objType, VkObject object, uint32_t allocationIdx, VkDeviceMemory mem, VkDeviceSize offset)
 {
 
-    VkResult result = nextTable.QueueBindObjectMemory(queue, objType, object, allocationIdx, mem, offset);
+    VkResult result = nextTable.BindObjectMemory(device, objType, object, allocationIdx, mem, offset);
     return result;
 }
 
-VK_LAYER_EXPORT VkResult VKAPI vkQueueBindObjectMemoryRange(VkQueue queue, VkObjectType objType, VkObject object, uint32_t allocationIdx, VkDeviceSize rangeOffset, VkDeviceSize rangeSize, VkDeviceMemory mem, VkDeviceSize memOffset)
+VK_LAYER_EXPORT VkResult VKAPI vkQueueBindSparseBufferMemory(VkQueue queue, VkBuffer buffer, uint32_t allocationIdx, VkDeviceSize rangeOffset, VkDeviceSize rangeSize, VkDeviceMemory mem, VkDeviceSize memOffset)
 {
 
-    VkResult result = nextTable.QueueBindObjectMemoryRange(queue, objType, object, allocationIdx, rangeOffset, rangeSize, mem, memOffset);
+    VkResult result = nextTable.QueueBindSparseBufferMemory(queue, buffer, allocationIdx, rangeOffset, rangeSize, mem, memOffset);
     return result;
 }
 
-VK_LAYER_EXPORT VkResult VKAPI vkQueueBindImageMemoryRange(VkQueue queue, VkImage image, uint32_t allocationIdx, const VkImageMemoryBindInfo* pBindInfo, VkDeviceMemory mem, VkDeviceSize memOffset)
+VK_LAYER_EXPORT VkResult VKAPI vkQueueBindSparseImageMemory(VkQueue queue, VkImage image, uint32_t allocationIdx, const VkImageMemoryBindInfo* pBindInfo, VkDeviceMemory mem, VkDeviceSize memOffset)
 {
     char str[1024];
     if (!pBindInfo) {
-        sprintf(str, "Struct ptr parameter pBindInfo to function QueueBindImageMemoryRange is NULL.");
+        sprintf(str, "Struct ptr parameter pBindInfo to function QueueBindSparseImageMemory is NULL.");
         layerCbMsg(VK_DBG_MSG_UNKNOWN, VK_VALIDATION_LEVEL_0, NULL, 0, 1, "PARAMCHECK", str);
     }
     else if (!vk_validate_vkimagememorybindinfo(pBindInfo)) {
         sprintf(str, "Parameter pBindInfo to function BindImageMemoryRange contains an invalid value.");
         layerCbMsg(VK_DBG_MSG_ERROR, VK_VALIDATION_LEVEL_0, NULL, 0, 1, "PARAMCHECK", str);
     }
-    VkResult result = nextTable.QueueBindImageMemoryRange(queue, image, allocationIdx, pBindInfo, mem, memOffset);
+    VkResult result = nextTable.QueueBindSparseImageMemory(queue, image, allocationIdx, pBindInfo, mem, memOffset);
     return result;
 }
 
index 775b29cf3cad37154efe4441d49c0122ecdf3ddb..28bb9e3bb1d86be55e30541492c7a9560365e614 100644 (file)
@@ -90,12 +90,12 @@ static inline void* globalGetProcAddr(const char *name)
         return (void*) vkDestroyObject;
     if (!strcmp(name, "GetObjectInfo"))
         return (void*) vkGetObjectInfo;
-    if (!strcmp(name, "QueueBindObjectMemory"))
-        return (void*) vkQueueBindObjectMemory;
-    if (!strcmp(name, "QueueBindObjectMemoryRange"))
-        return (void*) vkQueueBindObjectMemoryRange;
-    if (!strcmp(name, "QueueBindImageMemoryRange"))
-        return (void*) vkQueueBindImageMemoryRange;
+    if (!strcmp(name, "BindObjectMemory"))
+        return (void*) vkBindObjectMemory;
+    if (!strcmp(name, "QueueBindSparseBufferMemory"))
+        return (void*) vkQueueBindSparseBufferMemory;
+    if (!strcmp(name, "QueueBindSparseImageMemory"))
+        return (void*) vkQueueBindSparseImageMemory;
     if (!strcmp(name, "CreateFence"))
         return (void*) vkCreateFence;
     if (!strcmp(name, "ResetFences"))
index da2f7f1143bbe37406ef0ad8e84d1fdd011a4f7c..1e2a99fb7e21c382c3e799a271388dd019df19a3 100644 (file)
@@ -61,9 +61,9 @@ static inline void loader_initialize_dispatch_table(VkLayerDispatchTable *table,
     table->OpenPeerImage = (PFN_vkOpenPeerImage) gpa(gpu, "vkOpenPeerImage");
     table->DestroyObject = (PFN_vkDestroyObject) gpa(gpu, "vkDestroyObject");
     table->GetObjectInfo = (PFN_vkGetObjectInfo) gpa(gpu, "vkGetObjectInfo");
-    table->QueueBindObjectMemory = (PFN_vkQueueBindObjectMemory) gpa(gpu, "vkQueueBindObjectMemory");
-    table->QueueBindObjectMemoryRange = (PFN_vkQueueBindObjectMemoryRange) gpa(gpu, "vkQueueBindObjectMemoryRange");
-    table->QueueBindImageMemoryRange = (PFN_vkQueueBindImageMemoryRange) gpa(gpu, "vkQueueBindImageMemoryRange");
+    table->BindObjectMemory = (PFN_vkBindObjectMemory) gpa(gpu, "vkBindObjectMemory");
+    table->QueueBindSparseBufferMemory = (PFN_vkQueueBindSparseBufferMemory) gpa(gpu, "vkQueueBindSparseBufferMemory");
+    table->QueueBindSparseImageMemory = (PFN_vkQueueBindSparseImageMemory) gpa(gpu, "vkQueueBindSparseImageMemory");
     table->CreateFence = (PFN_vkCreateFence) gpa(gpu, "vkCreateFence");
     table->ResetFences = (PFN_vkResetFences) gpa(gpu, "vkResetFences");
     table->GetFenceStatus = (PFN_vkGetFenceStatus) gpa(gpu, "vkGetFenceStatus");
@@ -226,12 +226,12 @@ static inline void *loader_lookup_dispatch_table(const VkLayerDispatchTable *tab
         return (void *) table->DestroyObject;
     if (!strcmp(name, "GetObjectInfo"))
         return (void *) table->GetObjectInfo;
-    if (!strcmp(name, "QueueBindObjectMemory"))
-        return (void *) table->QueueBindObjectMemory;
-    if (!strcmp(name, "QueueBindObjectMemoryRange"))
-        return (void *) table->QueueBindObjectMemoryRange;
-    if (!strcmp(name, "QueueBindImageMemoryRange"))
-        return (void *) table->QueueBindImageMemoryRange;
+    if (!strcmp(name, "BindObjectMemory"))
+        return (void *) table->BindObjectMemory;
+    if (!strcmp(name, "QueueBindSparseBufferMemory"))
+        return (void *) table->QueueBindSparseBufferMemory;
+    if (!strcmp(name, "QueueBindSparseImageMemory"))
+        return (void *) table->QueueBindSparseImageMemory;
     if (!strcmp(name, "CreateFence"))
         return (void *) table->CreateFence;
     if (!strcmp(name, "ResetFences"))
index d393c2be159b620e6a8ee991a35a654bfb256c8e..f31bd647d2f114499ffc63189471beeea8e06eae 100644 (file)
@@ -254,31 +254,31 @@ LOADER_EXPORT VkResult VKAPI vkGetObjectInfo(VkDevice device, VkObjectType objTy
     return disp->GetObjectInfo(device, objType, object, infoType, pDataSize, pData);
 }
 
-LOADER_EXPORT VkResult VKAPI vkQueueBindObjectMemory(VkQueue queue, VkObjectType objType, VkObject object, uint32_t allocationIdx, VkDeviceMemory mem, VkDeviceSize offset)
+LOADER_EXPORT VkResult VKAPI vkBindObjectMemory(VkDevice device, VkObjectType objType, VkObject object, uint32_t allocationIdx, VkDeviceMemory mem, VkDeviceSize offset)
 {
     const VkLayerDispatchTable *disp;
 
-    disp = loader_get_dispatch(queue);
+    disp = loader_get_dispatch(device);
 
-    return disp->QueueBindObjectMemory(queue, objType, object, allocationIdx, mem, offset);
+    return disp->BindObjectMemory(device, objType, object, allocationIdx, mem, offset);
 }
 
-LOADER_EXPORT VkResult VKAPI vkQueueBindObjectMemoryRange(VkQueue queue, VkObjectType objType, VkObject object, uint32_t allocationIdx, VkDeviceSize rangeOffset, VkDeviceSize rangeSize, VkDeviceMemory mem, VkDeviceSize memOffset)
+LOADER_EXPORT VkResult VKAPI vkQueueBindSparseBufferMemory(VkQueue queue, VkBuffer buffer, uint32_t allocationIdx, VkDeviceSize rangeOffset, VkDeviceSize rangeSize, VkDeviceMemory mem, VkDeviceSize memOffset)
 {
     const VkLayerDispatchTable *disp;
 
     disp = loader_get_dispatch(queue);
 
-    return disp->QueueBindObjectMemoryRange(queue, objType, object, allocationIdx, rangeOffset, rangeSize, mem, memOffset);
+    return disp->QueueBindSparseBufferMemory(queue, buffer, allocationIdx, rangeOffset, rangeSize, mem, memOffset);
 }
 
-LOADER_EXPORT VkResult VKAPI vkQueueBindImageMemoryRange(VkQueue queue, VkImage image, uint32_t allocationIdx, const VkImageMemoryBindInfo* pBindInfo, VkDeviceMemory mem, VkDeviceSize memOffset)
+LOADER_EXPORT VkResult VKAPI vkQueueBindSparseImageMemory(VkQueue queue, VkImage image, uint32_t allocationIdx, const VkImageMemoryBindInfo* pBindInfo, VkDeviceMemory mem, VkDeviceSize memOffset)
 {
     const VkLayerDispatchTable *disp;
 
     disp = loader_get_dispatch(queue);
 
-    return disp->QueueBindImageMemoryRange(queue, image, allocationIdx, pBindInfo, mem, memOffset);
+    return disp->QueueBindSparseImageMemory(queue, image, allocationIdx, pBindInfo, mem, memOffset);
 }
 
 LOADER_EXPORT VkResult VKAPI vkCreateFence(VkDevice device, const VkFenceCreateInfo* pCreateInfo, VkFence* pFence)
index d3bfe35d405087d06b68c8cfc813f2b479aa602f..574999811cf82cd266a4b07f07c1c7fb9e8cbde6 100644 (file)
@@ -55,9 +55,9 @@ EXPORTS
    vkOpenPeerImage
    vkDestroyObject
    vkGetObjectInfo
-   vkQueueBindObjectMemory
-   vkQueueBindObjectMemoryRange
-   vkQueueBindImageMemoryRange
+   vkBindObjectMemory
+   vkQueueBindSparseBufferMemory
+   vkQueueBindSparseImageMemory
    vkCreateFence
    vkResetFences
    vkGetFenceStatus
index 0d375c7b5e8d996ad13b13d1bb2bc6be5b03553b..cc30a2274b64b9c85f39a1e731a1674439485eeb 100755 (executable)
@@ -1115,11 +1115,11 @@ class ObjectTrackerSubcommand(Subcommand):
         header_txt.append('    }')
         header_txt.append('    if (pQueueInfo != NULL) {')
         header_txt.append('        char str[1024];\n')
-        header_txt.append('        if ((queueInfo != NULL) && (queueInfo[pQueueInfo->queueNodeIndex].queueFlags & VK_QUEUE_MEMMGR_BIT) == 0) {')
-        header_txt.append('            sprintf(str, "Attempting %s on a non-memory-management capable queue -- VK_QUEUE_MEMMGR_BIT not set", function);')
+        header_txt.append('        if ((queueInfo != NULL) && (queueInfo[pQueueInfo->queueNodeIndex].queueFlags & VK_QUEUE_SPARSE_MEMMGR_BIT) == 0) {')
+        header_txt.append('            sprintf(str, "Attempting %s on a non-memory-management capable queue -- VK_QUEUE_SPARSE_MEMMGR_BIT not set", function);')
         header_txt.append('            layerCbMsg(VK_DBG_MSG_ERROR, VK_VALIDATION_LEVEL_0, queue, 0, OBJTRACK_UNKNOWN_OBJECT, "OBJTRACK", str);')
         header_txt.append('        } else {')
-        header_txt.append('            sprintf(str, "Attempting %s on a possibly non-memory-management capable queue -- VK_QUEUE_MEMMGR_BIT not known", function);')
+        header_txt.append('            sprintf(str, "Attempting %s on a possibly non-memory-management capable queue -- VK_QUEUE_SPARSE_MEMMGR_BIT not known", function);')
         header_txt.append('            layerCbMsg(VK_DBG_MSG_ERROR, VK_VALIDATION_LEVEL_0, queue, 0, OBJTRACK_UNKNOWN_OBJECT, "OBJTRACK", str);')
         header_txt.append('        }')
         header_txt.append('    }')
@@ -1184,19 +1184,14 @@ class ObjectTrackerSubcommand(Subcommand):
             using_line += '    // validate_memory_mapping_status(pMemRefs, memRefCount);\n'
             using_line += '    // validate_mem_ref_count(memRefCount);\n'
             using_line += '    loader_platform_thread_unlock_mutex(&objLock);\n'
-        elif 'QueueBindObjectMemoryRange' in proto.name:
+        elif 'QueueBindSparse' in proto.name:
             using_line  = '    loader_platform_thread_lock_mutex(&objLock);\n'
-            using_line += '    validateObjectType("vk%s", objType, object);\n' % (proto.name)
             using_line += '    validateQueueFlags(queue, "%s");\n' % (proto.name)
             using_line += '    loader_platform_thread_unlock_mutex(&objLock);\n'
         elif 'QueueBindObject' in proto.name:
             using_line  = '    loader_platform_thread_lock_mutex(&objLock);\n'
             using_line += '    validateObjectType("vk%s", objType, object);\n' % (proto.name)
             using_line += '    loader_platform_thread_unlock_mutex(&objLock);\n'
-        elif 'QueueBindImage' in proto.name:
-            using_line  = '    loader_platform_thread_lock_mutex(&objLock);\n'
-            using_line += '    validateQueueFlags(queue, "%s");\n' % (proto.name)
-            using_line += '    loader_platform_thread_unlock_mutex(&objLock);\n'
         elif 'GetObjectInfo' in proto.name:
             using_line  = '    loader_platform_thread_lock_mutex(&objLock);\n'
             using_line += '    validateObjectType("vk%s", objType, object);\n' % (proto.name)
index 9030ea43ddb19923e937a8c8182dbe3223d22212..e2a6905e814404c66a482605afea5e57de408017 100755 (executable)
--- a/vulkan.py
+++ b/vulkan.py
@@ -370,25 +370,24 @@ core = Extension(
              Param("size_t*", "pDataSize"),
              Param("void*", "pData")]),
 
-        Proto("VkResult", "QueueBindObjectMemory",
-            [Param("VkQueue", "queue"),
+        Proto("VkResult", "BindObjectMemory",
+            [Param("VkDevice", "device"),
              Param("VkObjectType", "objType"), 
              Param("VkObject", "object"),
              Param("uint32_t", "allocationIdx"),
              Param("VkDeviceMemory", "mem"),
              Param("VkDeviceSize", "offset")]),
 
-        Proto("VkResult", "QueueBindObjectMemoryRange",
+        Proto("VkResult", "QueueBindSparseBufferMemory",
             [Param("VkQueue", "queue"),
-             Param("VkObjectType", "objType"), 
-             Param("VkObject", "object"),
+             Param("VkBuffer", "buffer"),
              Param("uint32_t", "allocationIdx"),
              Param("VkDeviceSize", "rangeOffset"),
              Param("VkDeviceSize", "rangeSize"),
              Param("VkDeviceMemory", "mem"),
              Param("VkDeviceSize", "memOffset")]),
 
-        Proto("VkResult", "QueueBindImageMemoryRange",
+        Proto("VkResult", "QueueBindSparseImageMemory",
             [Param("VkQueue", "queue"),
              Param("VkImage", "image"),
              Param("uint32_t", "allocationIdx"),