vulkan.h: V99 -- Remove vkSetMemoryPriority, Bug# 13925

Conflicts:
	layers/mem_tracker.cpp
diff --git a/demos/cube.c b/demos/cube.c
index cea5ffd..5c93b93 100644
--- a/demos/cube.c
+++ b/demos/cube.c
@@ -658,7 +658,6 @@
         .pNext = NULL,
         .allocationSize = 0,
         .memProps = VK_MEMORY_PROPERTY_DEVICE_ONLY,
-        .memPriority = VK_MEMORY_PRIORITY_NORMAL,
     };
     VkDepthStencilViewCreateInfo view = {
         .sType = VK_STRUCTURE_TYPE_DEPTH_STENCIL_VIEW_CREATE_INFO,
@@ -902,7 +901,6 @@
         .pNext = NULL,
         .allocationSize = 0,
         .memProps = mem_props,
-        .memPriority = VK_MEMORY_PRIORITY_NORMAL,
     };
 
     VkMemoryRequirements mem_reqs;
@@ -1092,7 +1090,6 @@
         .pNext = NULL,
         .allocationSize = 0,
         .memProps = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
-        .memPriority = VK_MEMORY_PRIORITY_NORMAL,
     };
     VkMemoryRequirements mem_reqs;
     size_t mem_reqs_size = sizeof(VkMemoryRequirements);
diff --git a/demos/tri.c b/demos/tri.c
index 2dcfaa5..4728d7c 100644
--- a/demos/tri.c
+++ b/demos/tri.c
@@ -458,7 +458,6 @@
         .pNext = NULL,
         .allocationSize = 0,
         .memProps = VK_MEMORY_PROPERTY_DEVICE_ONLY,
-        .memPriority = VK_MEMORY_PRIORITY_NORMAL,
     };
     VkDepthStencilViewCreateInfo view = {
         .sType = VK_STRUCTURE_TYPE_DEPTH_STENCIL_VIEW_CREATE_INFO,
@@ -542,7 +541,6 @@
         .pNext = NULL,
         .allocationSize = 0,
         .memProps = mem_props,
-        .memPriority = VK_MEMORY_PRIORITY_NORMAL,
     };
 
     VkMemoryRequirements mem_reqs;
@@ -744,7 +742,6 @@
         .pNext = NULL,
         .allocationSize = 0,
         .memProps = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
-        .memPriority = VK_MEMORY_PRIORITY_NORMAL,
     };
     VkMemoryRequirements mem_reqs;
     size_t mem_reqs_size = sizeof(VkMemoryRequirements);
diff --git a/icd/intel/mem.c b/icd/intel/mem.c
index 11a7842..a68d96e 100644
--- a/icd/intel/mem.c
+++ b/icd/intel/mem.c
@@ -92,13 +92,6 @@
     return VK_SUCCESS;
 }
 
-VkResult intel_mem_set_priority(struct intel_mem *mem,
-                                  VkMemoryPriority priority)
-{
-    /* pin the bo when VK_MEMORY_PRIORITY_VERY_HIGH? */
-    return VK_SUCCESS;
-}
-
 ICD_EXPORT VkResult VKAPI vkAllocMemory(
     VkDevice                                device,
     const VkMemoryAllocInfo*                pAllocInfo,
@@ -120,16 +113,6 @@
     return VK_SUCCESS;
 }
 
-ICD_EXPORT VkResult VKAPI vkSetMemoryPriority(
-    VkDevice                                 device,
-    VkDeviceMemory                           mem_,
-    VkMemoryPriority                         priority)
-{
-    struct intel_mem *mem = intel_mem(mem_);
-
-    return intel_mem_set_priority(mem, priority);
-}
-
 ICD_EXPORT VkResult VKAPI vkMapMemory(
     VkDevice                                  device,
     VkDeviceMemory                            mem_,
diff --git a/icd/intel/mem.h b/icd/intel/mem.h
index df2a532..35b75e4 100644
--- a/icd/intel/mem.h
+++ b/icd/intel/mem.h
@@ -49,9 +49,6 @@
                                     size_t size,
                                     struct intel_mem **mem_ret);
 
-VkResult intel_mem_set_priority(struct intel_mem *mem,
-                                  VkMemoryPriority priority);
-
 static inline void *intel_mem_map(struct intel_mem *mem, VkFlags flags)
 {
     return intel_bo_map_async(mem->bo);
diff --git a/icd/intel/wsi_x11.c b/icd/intel/wsi_x11.c
index e66de47..fc23f5c 100644
--- a/icd/intel/wsi_x11.c
+++ b/icd/intel/wsi_x11.c
@@ -347,7 +347,6 @@
     mem_info.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO;
     mem_info.allocationSize = img->total_size;
     mem_info.memProps =  0;
-    mem_info.memPriority = VK_MEMORY_PRIORITY_HIGH;
 
     ret = intel_mem_alloc(dev, &mem_info, &mem);
     if (ret != VK_SUCCESS) {
diff --git a/icd/nulldrv/nulldrv.c b/icd/nulldrv/nulldrv.c
index 05c9acb..e1b1cf4 100644
--- a/icd/nulldrv/nulldrv.c
+++ b/icd/nulldrv/nulldrv.c
@@ -1668,15 +1668,6 @@
     return VK_SUCCESS;
 }
 
-ICD_EXPORT VkResult VKAPI vkSetMemoryPriority(
-    VkDevice                                    device,
-    VkDeviceMemory                              mem_,
-    VkMemoryPriority                            priority)
-{
-    NULLDRV_LOG_FUNC;
-    return VK_SUCCESS;
-}
-
 ICD_EXPORT VkResult VKAPI vkMapMemory(
     VkDevice                                    device,
     VkDeviceMemory                              mem_,
diff --git a/include/vkLayer.h b/include/vkLayer.h
index 745fe14..6c60af8 100644
--- a/include/vkLayer.h
+++ b/include/vkLayer.h
@@ -36,7 +36,6 @@
     PFN_vkDeviceWaitIdle DeviceWaitIdle;
     PFN_vkAllocMemory AllocMemory;
     PFN_vkFreeMemory FreeMemory;
-    PFN_vkSetMemoryPriority SetMemoryPriority;
     PFN_vkMapMemory MapMemory;
     PFN_vkUnmapMemory UnmapMemory;
     PFN_vkFlushMappedMemoryRanges FlushMappedMemoryRanges;
diff --git a/include/vulkan.h b/include/vulkan.h
index 73ca57e..113ed41 100644
--- a/include/vulkan.h
+++ b/include/vulkan.h
@@ -33,7 +33,7 @@
 #include "vk_platform.h"
 
 // Vulkan API version supported by this file
-#define VK_API_VERSION VK_MAKE_VERSION(0, 98, 0)
+#define VK_API_VERSION VK_MAKE_VERSION(0, 99, 0)
 
 #ifdef __cplusplus
 extern "C"
@@ -135,18 +135,6 @@
 // ------------------------------------------------------------------------------------------------
 // Enumerations
 
-typedef enum VkMemoryPriority_
-{
-    VK_MEMORY_PRIORITY_UNUSED                               = 0x00000000,
-    VK_MEMORY_PRIORITY_VERY_LOW                             = 0x00000001,
-    VK_MEMORY_PRIORITY_LOW                                  = 0x00000002,
-    VK_MEMORY_PRIORITY_NORMAL                               = 0x00000003,
-    VK_MEMORY_PRIORITY_HIGH                                 = 0x00000004,
-    VK_MEMORY_PRIORITY_VERY_HIGH                            = 0x00000005,
-
-    VK_ENUM_RANGE(MEMORY_PRIORITY, UNUSED, VERY_HIGH)
-} VkMemoryPriority;
-
 typedef enum VkImageLayout_
 {
     VK_IMAGE_LAYOUT_UNDEFINED                               = 0x00000000,   // Implicit layout an image is when its contents are undefined due to various reasons (e.g. right after creation)
@@ -1360,7 +1348,6 @@
     const void*                                 pNext;                      // Pointer to next structure
     VkDeviceSize                                allocationSize;             // Size of memory allocation
     VkMemoryPropertyFlags                       memProps;                   // Memory property flags
-    VkMemoryPriority                            memPriority;
 } VkMemoryAllocInfo;
 
 typedef struct VkMemoryOpenInfo_
@@ -2092,7 +2079,6 @@
 typedef VkResult (VKAPI *PFN_vkDeviceWaitIdle)(VkDevice device);
 typedef VkResult (VKAPI *PFN_vkAllocMemory)(VkDevice device, const VkMemoryAllocInfo* pAllocInfo, VkDeviceMemory* pMem);
 typedef VkResult (VKAPI *PFN_vkFreeMemory)(VkDevice device, VkDeviceMemory mem);
-typedef VkResult (VKAPI *PFN_vkSetMemoryPriority)(VkDevice device, VkDeviceMemory mem, VkMemoryPriority priority);
 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_vkFlushMappedMemoryRanges)(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges);
@@ -2275,11 +2261,6 @@
     VkDevice                                    device,
     VkDeviceMemory                              mem);
 
-VkResult VKAPI vkSetMemoryPriority(
-    VkDevice                                    device,
-    VkDeviceMemory                              mem,
-    VkMemoryPriority                            priority);
-
 VkResult VKAPI vkMapMemory(
     VkDevice                                    device,
     VkDeviceMemory                              mem,
diff --git a/layers/mem_tracker.cpp b/layers/mem_tracker.cpp
index 44fc5d9..ece8bc7 100644
--- a/layers/mem_tracker.cpp
+++ b/layers/mem_tracker.cpp
@@ -1105,17 +1105,6 @@
     return result;
 }
 
-VK_LAYER_EXPORT VkResult VKAPI vkSetMemoryPriority(
-    VkDevice         device,
-    VkDeviceMemory   mem,
-    VkMemoryPriority priority)
-{
-    // TODO : Update tracking for this alloc
-    //  Make sure memory is not pinned, which can't have priority set
-    VkResult result = get_dispatch_table(mem_tracker_device_table_map, device)->SetMemoryPriority(device, mem, priority);
-    return result;
-}
-
 VK_LAYER_EXPORT VkResult VKAPI vkMapMemory(
     VkDevice         device,
     VkDeviceMemory   mem,
@@ -2212,8 +2201,6 @@
         return (void*) vkAllocMemory;
     if (!strcmp(funcName, "vkFreeMemory"))
         return (void*) vkFreeMemory;
-    if (!strcmp(funcName, "vkSetMemoryPriority"))
-        return (void*) vkSetMemoryPriority;
     if (!strcmp(funcName, "vkMapMemory"))
         return (void*) vkMapMemory;
     if (!strcmp(funcName, "vkUnmapMemory"))
diff --git a/layers/param_checker.cpp b/layers/param_checker.cpp
index 680c637..5c92cb0 100644
--- a/layers/param_checker.cpp
+++ b/layers/param_checker.cpp
@@ -431,17 +431,6 @@
     return result;
 }
 
-VK_LAYER_EXPORT VkResult VKAPI vkSetMemoryPriority(VkDevice device, VkDeviceMemory mem, VkMemoryPriority priority)
-{
-    char str[1024];
-    if (!validate_VkMemoryPriority(priority)) {
-        sprintf(str, "Parameter priority to function SetMemoryPriority has invalid value of %i.", (int)priority);
-        layerCbMsg(VK_DBG_REPORT_ERROR_BIT, (VkObjectType) 0, NULL, 0, 1, "PARAMCHECK", str);
-    }
-    VkResult result = device_dispatch_table(device)->SetMemoryPriority(device, mem, priority);
-    return result;
-}
-
 VK_LAYER_EXPORT VkResult VKAPI vkMapMemory(VkDevice device, VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size, VkFlags flags, void** ppData)
 {
 
@@ -1997,8 +1986,6 @@
         return (void*) vkAllocMemory;
     if (!strcmp(name, "FreeMemory"))
         return (void*) vkFreeMemory;
-    if (!strcmp(name, "SetMemoryPriority"))
-        return (void*) vkSetMemoryPriority;
     if (!strcmp(name, "MapMemory"))
         return (void*) vkMapMemory;
     if (!strcmp(name, "UnmapMemory"))
diff --git a/loader/gpa_helper.h b/loader/gpa_helper.h
index 4fe8d38..c02d74f 100644
--- a/loader/gpa_helper.h
+++ b/loader/gpa_helper.h
@@ -63,8 +63,6 @@
         return (void*) vkAllocMemory;
     if (!strcmp(name, "FreeMemory"))
         return (void*) vkFreeMemory;
-    if (!strcmp(name, "SetMemoryPriority"))
-        return (void*) vkSetMemoryPriority;
     if (!strcmp(name, "MapMemory"))
         return (void*) vkMapMemory;
     if (!strcmp(name, "UnmapMemory"))
diff --git a/loader/table_ops.h b/loader/table_ops.h
index 15a3007..2963b20 100644
--- a/loader/table_ops.h
+++ b/loader/table_ops.h
@@ -44,7 +44,6 @@
     table->DeviceWaitIdle = (PFN_vkDeviceWaitIdle) gpa(dev, "vkDeviceWaitIdle");
     table->AllocMemory = (PFN_vkAllocMemory) gpa(dev, "vkAllocMemory");
     table->FreeMemory = (PFN_vkFreeMemory) gpa(dev, "vkFreeMemory");
-    table->SetMemoryPriority = (PFN_vkSetMemoryPriority) gpa(dev, "vkSetMemoryPriority");
     table->MapMemory = (PFN_vkMapMemory) gpa(dev, "vkMapMemory");
     table->UnmapMemory = (PFN_vkUnmapMemory) gpa(dev, "vkUnmapMemory");
     table->FlushMappedMemoryRanges = (PFN_vkFlushMappedMemoryRanges) gpa(dev, "vkFlushMappedMemoryRanges");
@@ -173,8 +172,6 @@
         return (void *) table->AllocMemory;
     if (!strcmp(name, "FreeMemory"))
         return (void *) table->FreeMemory;
-    if (!strcmp(name, "SetMemoryPriority"))
-        return (void *) table->SetMemoryPriority;
     if (!strcmp(name, "MapMemory"))
         return (void *) table->MapMemory;
     if (!strcmp(name, "UnmapMemory"))
diff --git a/loader/trampoline.c b/loader/trampoline.c
index 318fc64..a5cdc90 100644
--- a/loader/trampoline.c
+++ b/loader/trampoline.c
@@ -280,15 +280,6 @@
     return disp->FreeMemory(device, mem);
 }
 
-LOADER_EXPORT VkResult VKAPI vkSetMemoryPriority(VkDevice device, VkDeviceMemory mem, VkMemoryPriority priority)
-{
-    const VkLayerDispatchTable *disp;
-
-    disp = loader_get_dispatch(device);
-
-    return disp->SetMemoryPriority(device, mem, priority);
-}
-
 LOADER_EXPORT VkResult VKAPI vkMapMemory(VkDevice device, VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size, VkFlags flags, void** ppData)
 {
     const VkLayerDispatchTable *disp;
diff --git a/loader/vulkan.def b/loader/vulkan.def
index d98c2e6..e44c07e 100644
--- a/loader/vulkan.def
+++ b/loader/vulkan.def
@@ -42,7 +42,6 @@
    vkDeviceWaitIdle
    vkAllocMemory
    vkFreeMemory
-   vkSetMemoryPriority
    vkMapMemory
    vkUnmapMemory
    vkFlushMappedMemoryRanges
diff --git a/tests/blit_tests.cpp b/tests/blit_tests.cpp
index 2e0c2cd..3c2a8b6 100644
--- a/tests/blit_tests.cpp
+++ b/tests/blit_tests.cpp
@@ -784,7 +784,6 @@
         memset(&mem_info, 0, sizeof(mem_info));
         mem_info.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO;
         mem_info.allocationSize = mem_req.size;
-        mem_info.memPriority = VK_MEMORY_PRIORITY_NORMAL;
         mem_info.memProps = VK_MEMORY_PROPERTY_SHAREABLE_BIT;
         err = vkAllocMemory(dev_.obj(), &mem_info, &event_mem);
         ASSERT_VK_SUCCESS(err);
diff --git a/tests/image_tests.cpp b/tests/image_tests.cpp
index 4ec2676..d9a6e27 100644
--- a/tests/image_tests.cpp
+++ b/tests/image_tests.cpp
@@ -228,7 +228,6 @@
     ASSERT_NE(0, mem_req.size) << "vkGetObjectInfo (Image): Failed - expect images to require memory";
     mem_info.allocationSize = mem_req.size;
     mem_info.memProps       = VK_MEMORY_PROPERTY_SHAREABLE_BIT;
-    mem_info.memPriority    = VK_MEMORY_PRIORITY_NORMAL;
 
     /* allocate memory */
     err = vkAllocMemory(device(), &mem_info, &m_image_mem);
diff --git a/tests/init.cpp b/tests/init.cpp
index b755d76..690aec8 100644
--- a/tests/init.cpp
+++ b/tests/init.cpp
@@ -150,9 +150,6 @@
                           VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
 
 
-    // TODO: Try variety of memory priorities
-    alloc_info.memPriority = VK_MEMORY_PRIORITY_NORMAL;
-
     err = vkAllocMemory(device(), &alloc_info, &gpu_mem);
     ASSERT_VK_SUCCESS(err);
 
@@ -206,7 +203,6 @@
         mem_info.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO;
         mem_info.allocationSize = mem_req.size;
         mem_info.memProps = VK_MEMORY_PROPERTY_SHAREABLE_BIT;
-        mem_info.memPriority = VK_MEMORY_PRIORITY_NORMAL;
         err = vkAllocMemory(device(), &mem_info, &event_mem);
         ASSERT_VK_SUCCESS(err);
 
@@ -299,8 +295,6 @@
         // TODO: Is a simple multiple all that's needed here?
         mem_info.allocationSize = mem_req.size * MAX_QUERY_SLOTS;
         mem_info.memProps = VK_MEMORY_PROPERTY_SHAREABLE_BIT;
-        mem_info.memPriority = VK_MEMORY_PRIORITY_NORMAL;
-        // TODO: Should this be pinned? Or maybe a separate test with pinned.
         err = vkAllocMemory(device(), &mem_info, &query_mem);
         ASSERT_VK_SUCCESS(err);
 
@@ -510,7 +504,6 @@
         mem_info.pNext = NULL;
         mem_info.allocationSize = mem_req.size;
         mem_info.memProps = VK_MEMORY_PROPERTY_SHAREABLE_BIT;
-        mem_info.memPriority = VK_MEMORY_PRIORITY_NORMAL;
         err = vkAllocMemory(device(), &mem_info, &image_mem);
         ASSERT_VK_SUCCESS(err);
 
diff --git a/tests/layer_validation_tests.cpp b/tests/layer_validation_tests.cpp
index 688bb71..4fc0e8e 100644
--- a/tests/layer_validation_tests.cpp
+++ b/tests/layer_validation_tests.cpp
@@ -426,7 +426,6 @@
         .allocationSize = 0,
         // Introduce failure, do NOT set memProps to VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT
         .memProps       = 0,
-        .memPriority    = VK_MEMORY_PRIORITY_NORMAL,
     };
 
     err = vkCreateImage(m_device->device(), &image_create_info, &image);
@@ -498,7 +497,6 @@
         .pNext          = NULL,
         .allocationSize = 0,
         .memProps       = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
-        .memPriority    = VK_MEMORY_PRIORITY_NORMAL,
     };
 
     err = vkCreateImage(m_device->device(), &image_create_info, &image);
@@ -570,7 +568,6 @@
         .pNext          = NULL,
         .allocationSize = 0,
         .memProps       = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
-        .memPriority    = VK_MEMORY_PRIORITY_NORMAL,
     };
 
     err = vkCreateImage(m_device->device(), &image_create_info, &image);
@@ -643,7 +640,6 @@
         .pNext          = NULL,
         .allocationSize = 0,
         .memProps       = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
-        .memPriority    = VK_MEMORY_PRIORITY_NORMAL,
     };
 
     err = vkCreateImage(m_device->device(), &image_create_info, &image);
@@ -717,7 +713,6 @@
         .pNext          = NULL,
         .allocationSize = 0,
         .memProps       = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
-        .memPriority    = VK_MEMORY_PRIORITY_NORMAL,
     };
 
     err = vkCreateImage(m_device->device(), &image_create_info, &image);
@@ -1746,7 +1741,6 @@
     mem_info.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO;
     mem_info.allocationSize = mem_req.size;
     mem_info.memProps = VK_MEMORY_PROPERTY_SHAREABLE_BIT;
-    mem_info.memPriority = VK_MEMORY_PRIORITY_NORMAL;
     err = vkAllocMemory(device(), &mem_info, &event_mem);
     ASSERT_VK_SUCCESS(err);
 
diff --git a/tests/vktestbinding.cpp b/tests/vktestbinding.cpp
index 9d43aef..ce58e01 100644
--- a/tests/vktestbinding.cpp
+++ b/tests/vktestbinding.cpp
@@ -524,11 +524,6 @@
     BaseObject::init(mem, VK_OBJECT_TYPE_DEVICE_MEMORY, false);
 }
 
-void GpuMemory::set_priority(VkMemoryPriority priority)
-{
-    EXPECT(vkSetMemoryPriority(dev_->obj(), obj(), priority) == VK_SUCCESS);
-}
-
 const void *GpuMemory::map(VkFlags flags) const
 {
     void *data;
diff --git a/tests/vktestbinding.h b/tests/vktestbinding.h
index a374cbc..697475e 100644
--- a/tests/vktestbinding.h
+++ b/tests/vktestbinding.h
@@ -309,9 +309,6 @@
 
     void init(const Device &dev, VkDeviceMemory mem);
 
-    // vkSetMemoryPriority()
-    void set_priority(VkMemoryPriority priority);
-
     // vkMapMemory()
     const void *map(VkFlags flags) const;
           void *map(VkFlags flags);
@@ -642,7 +639,6 @@
 
     info.allocationSize = reqs.size;
     info.memProps = reqs.memPropsRequired;
-    info.memPriority = VK_MEMORY_PRIORITY_NORMAL;
     return info;
 }
 
diff --git a/vulkan.py b/vulkan.py
index 97976c4..ed22451 100755
--- a/vulkan.py
+++ b/vulkan.py
@@ -291,11 +291,6 @@
             [Param("VkDevice", "device"),
              Param("VkDeviceMemory", "mem")]),
 
-        Proto("VkResult", "SetMemoryPriority",
-            [Param("VkDevice", "device"),
-             Param("VkDeviceMemory", "mem"),
-             Param("VkMemoryPriority", "priority")]),
-
         Proto("VkResult", "MapMemory",
             [Param("VkDevice", "device"),
              Param("VkDeviceMemory", "mem"),