v98: replace vkUpdateDescriptors() by vkUpdateDescriptorSets()
authorChia-I Wu <olv@lunarg.com>
Mon, 25 May 2015 08:27:55 +0000 (16:27 +0800)
committerMark Lobodzinski <mark@lunarg.com>
Tue, 2 Jun 2015 14:38:58 +0000 (09:38 -0500)
Only slightly tested.

Conflicts:
include/vulkan.h

14 files changed:
demos/cube.c
demos/tri.c
icd/nulldrv/nulldrv.c
include/vkLayer.h
include/vulkan.h
layers/draw_state.cpp
layers/draw_state.h
layers/glave_snapshot.c
layers/param_checker.cpp
loader/gpa_helper.h
loader/table_ops.h
loader/trampoline.c
loader/vulkan.def
vulkan.py

index 171ec1ae75d3173a00e54db3afd235dcdfcf40af..71f1d4cd53a81e2d7f73a360f63707e8011fe913 100644 (file)
@@ -318,7 +318,7 @@ struct demo {
         VkBuffer buf;
         VkDeviceMemory mem;
         VkBufferView view;
-        VkBufferViewAttachInfo attach;
+        VkDescriptorInfo desc;
     } uniform_data;
 
     VkCmdBuffer cmd;  // Buffer for initialization commands
@@ -1150,8 +1150,7 @@ void demo_prepare_cube_data_buffer(struct demo *demo)
     err = vkCreateBufferView(demo->device, &view_info, &demo->uniform_data.view);
     assert(!err);
 
-    demo->uniform_data.attach.sType = VK_STRUCTURE_TYPE_BUFFER_VIEW_ATTACH_INFO;
-    demo->uniform_data.attach.view = demo->uniform_data.view;
+    demo->uniform_data.desc.bufferView = demo->uniform_data.view;
 }
 
 static void demo_prepare_descriptor_layout(struct demo *demo)
@@ -1510,38 +1509,12 @@ static void demo_prepare_descriptor_pool(struct demo *demo)
 
 static void demo_prepare_descriptor_set(struct demo *demo)
 {
-    VkImageViewAttachInfo view_info[DEMO_TEXTURE_COUNT];
-    VkSamplerImageViewInfo combined_info[DEMO_TEXTURE_COUNT];
-    VkUpdateSamplerTextures update_fs;
-    VkUpdateBuffers update_vs;
-    const void *update_array[2] = { &update_vs, &update_fs };
+    VkDescriptorInfo tex_descs[DEMO_TEXTURE_COUNT];
+    VkWriteDescriptorSet writes[2];
     VkResult U_ASSERT_ONLY err;
     uint32_t count;
     uint32_t i;
 
-    for (i = 0; i < DEMO_TEXTURE_COUNT; i++) {
-        view_info[i].sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_ATTACH_INFO;
-        view_info[i].pNext = NULL;
-        view_info[i].view = demo->textures[i].view,
-        view_info[i].layout = VK_IMAGE_LAYOUT_GENERAL;
-
-        combined_info[i].sampler = demo->textures[i].sampler;
-        combined_info[i].pImageView = &view_info[i];
-    }
-
-    memset(&update_vs, 0, sizeof(update_vs));
-    update_vs.sType = VK_STRUCTURE_TYPE_UPDATE_BUFFERS;
-    update_vs.pNext = &update_fs;
-    update_vs.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
-    update_vs.count = 1;
-    update_vs.pBufferViews = &demo->uniform_data.attach;
-
-    memset(&update_fs, 0, sizeof(update_fs));
-    update_fs.sType = VK_STRUCTURE_TYPE_UPDATE_SAMPLER_TEXTURES;
-    update_fs.binding = 1;
-    update_fs.count = DEMO_TEXTURE_COUNT;
-    update_fs.pSamplerImageViews = combined_info;
-
     err = vkAllocDescriptorSets(demo->device, demo->desc_pool,
             VK_DESCRIPTOR_SET_USAGE_STATIC,
             1, &demo->desc_layout,
@@ -1549,7 +1522,31 @@ static void demo_prepare_descriptor_set(struct demo *demo)
     assert(!err && count == 1);
 
     vkClearDescriptorSets(demo->device, demo->desc_pool, 1, &demo->desc_set);
-    vkUpdateDescriptors(demo->device, demo->desc_set, 2, update_array);
+
+    memset(&tex_descs, 0, sizeof(tex_descs));
+    for (i = 0; i < DEMO_TEXTURE_COUNT; i++) {
+        tex_descs[i].sampler = demo->textures[i].sampler;
+        tex_descs[i].imageView = demo->textures[i].view;
+        tex_descs[i].imageLayout = VK_IMAGE_LAYOUT_GENERAL;
+    }
+
+    memset(&writes, 0, sizeof(writes));
+
+    writes[0].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
+    writes[0].destSet = demo->desc_set;
+    writes[0].count = 1;
+    writes[0].descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
+    writes[0].pDescriptors = &demo->uniform_data.desc;
+
+    writes[1].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
+    writes[1].destSet = demo->desc_set;
+    writes[1].destBinding = 1;
+    writes[1].count = DEMO_TEXTURE_COUNT;
+    writes[1].descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;
+    writes[1].pDescriptors = tex_descs;
+
+    err = vkUpdateDescriptorSets(demo->device, 2, writes, 0, NULL);
+    assert(!err);
 }
 
 static void demo_prepare(struct demo *demo)
index 6260e2815855eea9d797d151639ba806bcfe2345..26f759872fd7bc060f06811e0581293ef673065d 100644 (file)
@@ -1071,29 +1071,12 @@ static void demo_prepare_descriptor_pool(struct demo *demo)
 
 static void demo_prepare_descriptor_set(struct demo *demo)
 {
-    VkImageViewAttachInfo view_info[DEMO_TEXTURE_COUNT];
-    VkSamplerImageViewInfo combined_info[DEMO_TEXTURE_COUNT];
-    VkUpdateSamplerTextures update;
-    const void *update_array[1] = { &update };
+    VkDescriptorInfo tex_descs[DEMO_TEXTURE_COUNT];
+    VkWriteDescriptorSet write;
     VkResult U_ASSERT_ONLY err;
     uint32_t count;
     uint32_t i;
 
-    for (i = 0; i < DEMO_TEXTURE_COUNT; i++) {
-        view_info[i].sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_ATTACH_INFO;
-        view_info[i].pNext = NULL;
-        view_info[i].view = demo->textures[i].view,
-        view_info[i].layout = VK_IMAGE_LAYOUT_GENERAL;
-
-        combined_info[i].sampler = demo->textures[i].sampler;
-        combined_info[i].pImageView = &view_info[i];
-    }
-
-    memset(&update, 0, sizeof(update));
-    update.sType = VK_STRUCTURE_TYPE_UPDATE_SAMPLER_TEXTURES;
-    update.count = DEMO_TEXTURE_COUNT;
-    update.pSamplerImageViews = combined_info;
-
     err = vkAllocDescriptorSets(demo->device, demo->desc_pool,
             VK_DESCRIPTOR_SET_USAGE_STATIC,
             1, &demo->desc_layout,
@@ -1101,7 +1084,23 @@ static void demo_prepare_descriptor_set(struct demo *demo)
     assert(!err && count == 1);
 
     vkClearDescriptorSets(demo->device, demo->desc_pool, 1, &demo->desc_set);
-    vkUpdateDescriptors(demo->device, demo->desc_set, 1, update_array);
+
+    memset(&tex_descs, 0, sizeof(tex_descs));
+    for (i = 0; i < DEMO_TEXTURE_COUNT; i++) {
+        tex_descs[i].sampler = demo->textures[i].sampler;
+        tex_descs[i].imageView = demo->textures[i].view;
+        tex_descs[i].imageLayout = VK_IMAGE_LAYOUT_GENERAL;
+    }
+
+    memset(&write, 0, sizeof(write));
+    write.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
+    write.destSet = demo->desc_set;
+    write.count = DEMO_TEXTURE_COUNT;
+    write.descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;
+    write.pDescriptors = tex_descs;
+
+    err = vkUpdateDescriptorSets(demo->device, 1, &write, 0, NULL);
+    assert(!err);
 }
 
 static void demo_prepare(struct demo *demo)
index c67dd83d36086daafc8321d15b018c5d499321c9..5e4cdd8c082328af10e337b21a9c72bec0f69050 100644 (file)
@@ -2268,13 +2268,15 @@ ICD_EXPORT void VKAPI vkClearDescriptorSets(
     NULLDRV_LOG_FUNC;
 }
 
-ICD_EXPORT void VKAPI vkUpdateDescriptors(
-    VkDevice                                  device,
-    VkDescriptorSet                           descriptorSet,
-    uint32_t                                     updateCount,
-    const void**                                 ppUpdateArray)
+ICD_EXPORT VkResult VKAPI vkUpdateDescriptorSets(
+    VkDevice                                    device,
+    uint32_t                                    writeCount,
+    const VkWriteDescriptorSet*                 pDescriptorWrites,
+    uint32_t                                    copyCount,
+    const VkCopyDescriptorSet*                  pDescriptorCopies)
 {
     NULLDRV_LOG_FUNC;
+    return VK_SUCCESS;
 }
 
 ICD_EXPORT VkResult VKAPI vkCreateFramebuffer(
index e19b70678b36bb46ad4faff3fad3067ca8bb5110..65656a0050fa70cc7f0c967892d65a04f8c5bdaf 100644 (file)
@@ -93,7 +93,7 @@ typedef struct VkLayerDispatchTable_
     PFN_vkResetDescriptorPool ResetDescriptorPool;
     PFN_vkAllocDescriptorSets AllocDescriptorSets;
     PFN_vkClearDescriptorSets ClearDescriptorSets;
-    PFN_vkUpdateDescriptors UpdateDescriptors;
+    PFN_vkUpdateDescriptorSets UpdateDescriptorSets;
     PFN_vkCreateDynamicViewportState CreateDynamicViewportState;
     PFN_vkCreateDynamicRasterState CreateDynamicRasterState;
     PFN_vkCreateDynamicColorBlendState CreateDynamicColorBlendState;
index 30d2fb77e94c2f70c31c160f5810551a18b7f793..ed0ad2f87febe2c833d1623b96cff6ae05a484cb 100644 (file)
@@ -33,7 +33,7 @@
 #include "vk_platform.h"
 
 // Vulkan API version supported by this file
-#define VK_API_VERSION VK_MAKE_VERSION(0, 97, 2)
+#define VK_API_VERSION VK_MAKE_VERSION(0, 98, 0)
 
 #ifdef __cplusplus
 extern "C"
@@ -799,8 +799,8 @@ typedef enum VkStructureType_
     VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO                     = 2,
     VK_STRUCTURE_TYPE_MEMORY_OPEN_INFO                      = 3,
     VK_STRUCTURE_TYPE_PEER_MEMORY_OPEN_INFO                 = 4,
-    VK_STRUCTURE_TYPE_BUFFER_VIEW_ATTACH_INFO               = 5,
-    VK_STRUCTURE_TYPE_IMAGE_VIEW_ATTACH_INFO                = 6,
+//    VK_STRUCTURE_TYPE_BUFFER_VIEW_ATTACH_INFO               = 5,
+//    VK_STRUCTURE_TYPE_IMAGE_VIEW_ATTACH_INFO                = 6,
     VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO                = 7,
     VK_STRUCTURE_TYPE_COLOR_ATTACHMENT_VIEW_CREATE_INFO     = 8,
     VK_STRUCTURE_TYPE_DEPTH_STENCIL_VIEW_CREATE_INFO        = 9,
@@ -840,14 +840,11 @@ typedef enum VkStructureType_
     VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER                 = 43,
     VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER                  = 44,
     VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO           = 45,
-    VK_STRUCTURE_TYPE_UPDATE_SAMPLERS                       = 46,
-    VK_STRUCTURE_TYPE_UPDATE_SAMPLER_TEXTURES               = 47,
-    VK_STRUCTURE_TYPE_UPDATE_IMAGES                         = 48,
-    VK_STRUCTURE_TYPE_UPDATE_BUFFERS                        = 49,
-    VK_STRUCTURE_TYPE_UPDATE_AS_COPY                        = 50,
-    VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO                  = 51,
-    VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO           = 52,
-    VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE                   = 53,
+    VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET                  = 46,
+    VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET                   = 47,
+    VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO                  = 48,
+    VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO           = 49,
+    VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE                   = 50,
 
     VK_ENUM_RANGE(STRUCTURE_TYPE, APPLICATION_INFO, MAPPED_MEMORY_RANGE)
 } VkStructureType;
@@ -1412,79 +1409,44 @@ typedef struct VkFormatProperties_
     VkFormatFeatureFlags                        optimalTilingFeatures;      // Format features in case of optimal tiling
 } VkFormatProperties;
 
-typedef struct VkBufferViewAttachInfo_
+typedef struct VkDescriptorInfo_
 {
-    VkStructureType                             sType;                      // Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_ATTACH_INFO
-    const void*                                 pNext;                      // Pointer to next structure
-    VkBufferView                                view;
-} VkBufferViewAttachInfo;
+    VkBufferView                                bufferView;                 // Buffer view to write to the descriptor (in case it's a buffer descriptor, otherwise should be VK_NULL_HANDLE)
+    VkSampler                                   sampler;                    // Sampler to write to the descriptor (in case it's a SAMPLER or COMBINED_IMAGE_SAMPLER descriptor, otherwise should be VK_NULL_HANDLE)
+    VkImageView                                 imageView;                  // Image view to write to the descriptor (in case it's a SAMPLED_IMAGE, STORAGE_IMAGE, or COMBINED_IMAGE_SAMPLER descriptor, otherwise should be VK_NULL_HANDLE)
+    VkImageLayout                               imageLayout;                // Layout the image is expected to be in when accessed using this descriptor (only used if <imageView> is not VK_NULL_HANDLE)
+} VkDescriptorInfo;
 
-typedef struct VkImageViewAttachInfo_
+typedef struct VkWriteDescriptorSet_
 {
-    VkStructureType                             sType;                      // Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_ATTACH_INFO
+    VkStructureType                             sType;                      // Must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET
     const void*                                 pNext;                      // Pointer to next structure
-    VkImageView                                 view;
-    VkImageLayout                               layout;
-} VkImageViewAttachInfo;
 
-typedef struct VkUpdateSamplers_
-{
-    VkStructureType                             sType;                      // Must be VK_STRUCTURE_TYPE_UPDATE_SAMPLERS
-    const void*                                 pNext;                      // Pointer to next structure
-    uint32_t                                    binding;                    // Binding of the sampler (array)
-    uint32_t                                    arrayIndex;                 // First element of the array to update or zero otherwise
-    uint32_t                                    count;                      // Number of elements to update
-    const VkSampler*                            pSamplers;
-} VkUpdateSamplers;
+    VkDescriptorSet                             destSet;                    // Destination descriptor set
+    uint32_t                                    destBinding;                // Binding within the destination descriptor set to write
+    uint32_t                                    destArrayElement;           // Array element within the destination binding to write
 
-typedef struct VkSamplerImageViewInfo_
-{
-    VkSampler                                   sampler;
-    const VkImageViewAttachInfo*                pImageView;
-} VkSamplerImageViewInfo;
+    uint32_t                                    count;                      // Number of descriptors to write (determines the size of the array pointed by <pDescriptors>)
+
+    VkDescriptorType                            descriptorType;             // Descriptor type to write (determines which fields of the array pointed by <pDescriptors> are going to be used)
+    const VkDescriptorInfo*                     pDescriptors;               // Array of info structures describing the descriptors to write
+} VkWriteDescriptorSet;
 
-typedef struct VkUpdateSamplerTextures_
+typedef struct VkCopyDescriptorSet_
 {
-    VkStructureType                             sType;                      // Must be VK_STRUCTURE_TYPE_UPDATE_SAMPLER_TEXTURES
+    VkStructureType                             sType;                      // Must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET
     const void*                                 pNext;                      // Pointer to next structure
-    uint32_t                                    binding;                    // Binding of the combined texture sampler (array)
-    uint32_t                                    arrayIndex;                 // First element of the array to update or zero otherwise
-    uint32_t                                    count;                      // Number of elements to update
-    const VkSamplerImageViewInfo*               pSamplerImageViews;
-} VkUpdateSamplerTextures;
-
-typedef struct VkUpdateImages_
-{
-    VkStructureType                             sType;                     // Must be VK_STRUCTURE_TYPE_UPDATE_IMAGES
-    const void*                                 pNext;                     // Pointer to next structure
-    VkDescriptorType                            descriptorType;
-    uint32_t                                    binding;                   // Binding of the image (array)
-    uint32_t                                    arrayIndex;                // First element of the array to update or zero otherwise
-    uint32_t                                    count;                     // Number of elements to update
-    const VkImageViewAttachInfo*                pImageViews;
-} VkUpdateImages;
-
-typedef struct VkUpdateBuffers_
-{
-    VkStructureType                             sType;                    // Must be VK_STRUCTURE_TYPE_UPDATE_BUFFERS
-    const void*                                 pNext;                    // Pointer to next structure
-    VkDescriptorType                            descriptorType;
-    uint32_t                                    binding;                  // Binding of the buffer (array)
-    uint32_t                                    arrayIndex;               // First element of the array to update or zero otherwise
-    uint32_t                                    count;                    // Number of elements to update
-    const VkBufferViewAttachInfo*               pBufferViews;
-} VkUpdateBuffers;
-
-typedef struct VkUpdateAsCopy_
-{
-    VkStructureType                             sType;                      // Must be VK_STRUCTURE_TYPE_UPDATE_AS_COPY
-    const void*                                 pNext;                      // Pointer to next structure
-    VkDescriptorType                            descriptorType;
-    VkDescriptorSet                             descriptorSet;
-    uint32_t                                    binding;
-    uint32_t                                    arrayElement;
-    uint32_t                                    count;
-} VkUpdateAsCopy;
+
+    VkDescriptorSet                             srcSet;                     // Source descriptor set
+    uint32_t                                    srcBinding;                 // Binding within the source descriptor set to copy from
+    uint32_t                                    srcArrayElement;            // Array element within the source binding to copy from
+
+    VkDescriptorSet                             destSet;                    // Destination descriptor set
+    uint32_t                                    destBinding;                // Binding within the destination descriptor set to copy to
+    uint32_t                                    destArrayElement;           // Array element within the destination binding to copy to
+
+    uint32_t                                    count;                      // Number of descriptors to copy
+} VkCopyDescriptorSet;
 
 typedef struct VkBufferCreateInfo_
 {
@@ -2190,7 +2152,7 @@ typedef VkResult (VKAPI *PFN_vkCreateDescriptorPool)(VkDevice device, VkDescript
 typedef VkResult (VKAPI *PFN_vkResetDescriptorPool)(VkDevice device, VkDescriptorPool descriptorPool);
 typedef VkResult (VKAPI *PFN_vkAllocDescriptorSets)(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorSetUsage setUsage, uint32_t count, const VkDescriptorSetLayout* pSetLayouts, VkDescriptorSet* pDescriptorSets, uint32_t* pCount);
 typedef void     (VKAPI *PFN_vkClearDescriptorSets)(VkDevice device, VkDescriptorPool descriptorPool, uint32_t count, const VkDescriptorSet* pDescriptorSets);
-typedef void     (VKAPI *PFN_vkUpdateDescriptors)(VkDevice device, VkDescriptorSet descriptorSet, uint32_t updateCount, const void** ppUpdateArray);
+typedef VkResult (VKAPI *PFN_vkUpdateDescriptorSets)(VkDevice device, uint32_t writeCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t copyCount, const VkCopyDescriptorSet* pDescriptorCopies);
 typedef VkResult (VKAPI *PFN_vkCreateDynamicViewportState)(VkDevice device, const VkDynamicVpStateCreateInfo* pCreateInfo, VkDynamicVpState* pState);
 typedef VkResult (VKAPI *PFN_vkCreateDynamicRasterState)(VkDevice device, const VkDynamicRsStateCreateInfo* pCreateInfo, VkDynamicRsState* pState);
 typedef VkResult (VKAPI *PFN_vkCreateDynamicColorBlendState)(VkDevice device, const VkDynamicCbStateCreateInfo* pCreateInfo, VkDynamicCbState* pState);
@@ -2650,11 +2612,12 @@ void VKAPI vkClearDescriptorSets(
     uint32_t                                    count,
     const VkDescriptorSet*                      pDescriptorSets);
 
-void VKAPI vkUpdateDescriptors(
+VkResult VKAPI vkUpdateDescriptorSets(
     VkDevice                                    device,
-    VkDescriptorSet                             descriptorSet,
-    uint32_t                                    updateCount,
-    const void**                                ppUpdateArray);
+    uint32_t                                    writeCount,
+    const VkWriteDescriptorSet*                 pDescriptorWrites,
+    uint32_t                                    copyCount,
+    const VkCopyDescriptorSet*                  pDescriptorCopies);
 
 // State object functions
 
index d90b1ee07074fcae2382d5364725f106f3edd695..c78488d699699fbc899d318d1f9da365fd6fb4d4 100755 (executable)
@@ -577,11 +577,8 @@ static bool32_t validUpdateStruct(const GENERIC_HEADER* pUpdateStruct)
     char str[1024];
     switch (pUpdateStruct->sType)
     {
-        case VK_STRUCTURE_TYPE_UPDATE_SAMPLERS:
-        case VK_STRUCTURE_TYPE_UPDATE_SAMPLER_TEXTURES:
-        case VK_STRUCTURE_TYPE_UPDATE_IMAGES:
-        case VK_STRUCTURE_TYPE_UPDATE_BUFFERS:
-        case VK_STRUCTURE_TYPE_UPDATE_AS_COPY:
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET:
+        case VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET:
             return 1;
         default:
             sprintf(str, "Unexpected UPDATE struct of type %s (value %u) in vkUpdateDescriptors() struct tree", string_VkStructureType(pUpdateStruct->sType), pUpdateStruct->sType);
@@ -595,16 +592,10 @@ static uint32_t getUpdateBinding(const GENERIC_HEADER* pUpdateStruct)
     char str[1024];
     switch (pUpdateStruct->sType)
     {
-        case VK_STRUCTURE_TYPE_UPDATE_SAMPLERS:
-            return ((VkUpdateSamplers*)pUpdateStruct)->binding;
-        case VK_STRUCTURE_TYPE_UPDATE_SAMPLER_TEXTURES:
-            return ((VkUpdateSamplerTextures*)pUpdateStruct)->binding;
-        case VK_STRUCTURE_TYPE_UPDATE_IMAGES:
-            return ((VkUpdateImages*)pUpdateStruct)->binding;
-        case VK_STRUCTURE_TYPE_UPDATE_BUFFERS:
-            return ((VkUpdateBuffers*)pUpdateStruct)->binding;
-        case VK_STRUCTURE_TYPE_UPDATE_AS_COPY:
-            return ((VkUpdateAsCopy*)pUpdateStruct)->binding;
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET:
+            return ((VkWriteDescriptorSet*)pUpdateStruct)->destBinding;
+        case VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET:
+            return ((VkCopyDescriptorSet*)pUpdateStruct)->destBinding;
         default:
             sprintf(str, "Unexpected UPDATE struct of type %s (value %u) in vkUpdateDescriptors() struct tree", string_VkStructureType(pUpdateStruct->sType), pUpdateStruct->sType);
             layerCbMsg(VK_DBG_MSG_ERROR, VK_VALIDATION_LEVEL_0, NULL, 0, DRAWSTATE_INVALID_UPDATE_STRUCT, "DS", str);
@@ -617,17 +608,11 @@ static uint32_t getUpdateArrayIndex(const GENERIC_HEADER* pUpdateStruct)
     char str[1024];
     switch (pUpdateStruct->sType)
     {
-        case VK_STRUCTURE_TYPE_UPDATE_SAMPLERS:
-            return (((VkUpdateSamplers*)pUpdateStruct)->arrayIndex);
-        case VK_STRUCTURE_TYPE_UPDATE_SAMPLER_TEXTURES:
-            return (((VkUpdateSamplerTextures*)pUpdateStruct)->arrayIndex);
-        case VK_STRUCTURE_TYPE_UPDATE_IMAGES:
-            return (((VkUpdateImages*)pUpdateStruct)->arrayIndex);
-        case VK_STRUCTURE_TYPE_UPDATE_BUFFERS:
-            return (((VkUpdateBuffers*)pUpdateStruct)->arrayIndex);
-        case VK_STRUCTURE_TYPE_UPDATE_AS_COPY:
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET:
+            return ((VkWriteDescriptorSet*)pUpdateStruct)->destArrayElement;
+        case VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET:
             // TODO : Need to understand this case better and make sure code is correct
-            return (((VkUpdateAsCopy*)pUpdateStruct)->arrayElement);
+            return ((VkCopyDescriptorSet*)pUpdateStruct)->destArrayElement;
         default:
             sprintf(str, "Unexpected UPDATE struct of type %s (value %u) in vkUpdateDescriptors() struct tree", string_VkStructureType(pUpdateStruct->sType), pUpdateStruct->sType);
             layerCbMsg(VK_DBG_MSG_ERROR, VK_VALIDATION_LEVEL_0, NULL, 0, DRAWSTATE_INVALID_UPDATE_STRUCT, "DS", str);
@@ -640,17 +625,11 @@ static uint32_t getUpdateCount(const GENERIC_HEADER* pUpdateStruct)
     char str[1024];
     switch (pUpdateStruct->sType)
     {
-        case VK_STRUCTURE_TYPE_UPDATE_SAMPLERS:
-            return (((VkUpdateSamplers*)pUpdateStruct)->count);
-        case VK_STRUCTURE_TYPE_UPDATE_SAMPLER_TEXTURES:
-            return (((VkUpdateSamplerTextures*)pUpdateStruct)->count);
-        case VK_STRUCTURE_TYPE_UPDATE_IMAGES:
-            return (((VkUpdateImages*)pUpdateStruct)->count);
-        case VK_STRUCTURE_TYPE_UPDATE_BUFFERS:
-            return (((VkUpdateBuffers*)pUpdateStruct)->count);
-        case VK_STRUCTURE_TYPE_UPDATE_AS_COPY:
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET:
+            return ((VkWriteDescriptorSet*)pUpdateStruct)->count;
+        case VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET:
             // TODO : Need to understand this case better and make sure code is correct
-            return (((VkUpdateAsCopy*)pUpdateStruct)->count);
+            return ((VkCopyDescriptorSet*)pUpdateStruct)->count;
         default:
             sprintf(str, "Unexpected UPDATE struct of type %s (value %u) in vkUpdateDescriptors() struct tree", string_VkStructureType(pUpdateStruct->sType), pUpdateStruct->sType);
             layerCbMsg(VK_DBG_MSG_ERROR, VK_VALIDATION_LEVEL_0, NULL, 0, DRAWSTATE_INVALID_UPDATE_STRUCT, "DS", str);
@@ -694,20 +673,12 @@ static bool32_t validateUpdateType(const LAYOUT_NODE* pLayout, const GENERIC_HEA
     char str[1024];
     switch (pUpdateStruct->sType)
     {
-        case VK_STRUCTURE_TYPE_UPDATE_SAMPLERS:
-            actualType = VK_DESCRIPTOR_TYPE_SAMPLER;
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET:
+            actualType = ((VkWriteDescriptorSet*)pUpdateStruct)->descriptorType;
             break;
-        case VK_STRUCTURE_TYPE_UPDATE_SAMPLER_TEXTURES:
-            actualType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;
-            break;
-        case VK_STRUCTURE_TYPE_UPDATE_IMAGES:
-            actualType = ((VkUpdateImages*)pUpdateStruct)->descriptorType;
-            break;
-        case VK_STRUCTURE_TYPE_UPDATE_BUFFERS:
-            actualType = ((VkUpdateBuffers*)pUpdateStruct)->descriptorType;
-            break;
-        case VK_STRUCTURE_TYPE_UPDATE_AS_COPY:
-            actualType = ((VkUpdateAsCopy*)pUpdateStruct)->descriptorType;
+        case VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET:
+            /* no need to validate */
+            return 1;
             break;
         default:
             sprintf(str, "Unexpected UPDATE struct of type %s (value %u) in vkUpdateDescriptors() struct tree", string_VkStructureType(pUpdateStruct->sType), pUpdateStruct->sType);
@@ -726,61 +697,27 @@ static bool32_t validateUpdateType(const LAYOUT_NODE* pLayout, const GENERIC_HEA
 static GENERIC_HEADER* shadowUpdateNode(GENERIC_HEADER* pUpdate)
 {
     GENERIC_HEADER* pNewNode = NULL;
-    VkUpdateSamplers* pUS = NULL;
-    VkUpdateSamplerTextures* pUST = NULL;
-    VkUpdateBuffers* pUB = NULL;
-    VkUpdateImages* pUI = NULL;
-    VkUpdateAsCopy* pUAC = NULL;
+    VkWriteDescriptorSet* pWDS = NULL;
+    VkCopyDescriptorSet* pCDS = NULL;
     size_t array_size = 0;
     size_t base_array_size = 0;
     size_t total_array_size = 0;
     size_t baseBuffAddr = 0;
-    VkImageViewAttachInfo** ppLocalImageViews = NULL;
-    VkBufferViewAttachInfo** ppLocalBufferViews = NULL;
     char str[1024];
     switch (pUpdate->sType)
     {
-        case VK_STRUCTURE_TYPE_UPDATE_SAMPLERS:
-            pUS = new VkUpdateSamplers;
-            pNewNode = (GENERIC_HEADER*)pUS;
-            memcpy(pUS, pUpdate, sizeof(VkUpdateSamplers));
-            pUS->pSamplers = new VkSampler[pUS->count];
-            array_size = sizeof(VkSampler) * pUS->count;
-            memcpy((void*)pUS->pSamplers, ((VkUpdateSamplers*)pUpdate)->pSamplers, array_size);
-            break;
-        case VK_STRUCTURE_TYPE_UPDATE_SAMPLER_TEXTURES:
-            pUST = new VkUpdateSamplerTextures;
-            pNewNode = (GENERIC_HEADER*)pUST;
-            memcpy(pUST, pUpdate, sizeof(VkUpdateSamplerTextures));
-            pUST->pSamplerImageViews = new VkSamplerImageViewInfo[pUST->count];
-            array_size = sizeof(VkSamplerImageViewInfo) * pUST->count;
-            memcpy((void*)pUST->pSamplerImageViews, ((VkUpdateSamplerTextures*)pUpdate)->pSamplerImageViews, array_size);
-            for (uint32_t i = 0; i < pUST->count; i++) {
-                VkImageViewAttachInfo** ppIV = (VkImageViewAttachInfo**)&pUST->pSamplerImageViews[i].pImageView;
-                *ppIV = new VkImageViewAttachInfo;
-                memcpy((void*)*ppIV, ((VkUpdateSamplerTextures*)pUpdate)->pSamplerImageViews[i].pImageView, sizeof(VkImageViewAttachInfo));
-            }
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET:
+            pWDS = new VkWriteDescriptorSet;
+            pNewNode = (GENERIC_HEADER*)pWDS;
+            memcpy(pWDS, pUpdate, sizeof(VkWriteDescriptorSet));
+            pWDS->pDescriptors = new VkDescriptorInfo[pWDS->count];
+            array_size = sizeof(VkDescriptorInfo) * pWDS->count;
+            memcpy((void*)pWDS->pDescriptors, ((VkWriteDescriptorSet*)pUpdate)->pDescriptors, array_size);
             break;
-        case VK_STRUCTURE_TYPE_UPDATE_IMAGES:
-            pUI = new VkUpdateImages;
-            pNewNode = (GENERIC_HEADER*)pUI;
-            memcpy(pUI, pUpdate, sizeof(VkUpdateImages));
-            pUI->pImageViews = new VkImageViewAttachInfo[pUI->count];
-            array_size = (sizeof(VkImageViewAttachInfo) * pUI->count);
-            memcpy((void*)pUI->pImageViews, ((VkUpdateImages*)pUpdate)->pImageViews, array_size);
-            break;
-        case VK_STRUCTURE_TYPE_UPDATE_BUFFERS:
-            pUB = new VkUpdateBuffers;
-            pNewNode = (GENERIC_HEADER*)pUB;
-            memcpy(pUB, pUpdate, sizeof(VkUpdateBuffers));
-            pUB->pBufferViews = new VkBufferViewAttachInfo[pUB->count];
-            array_size = (sizeof(VkBufferViewAttachInfo) * pUB->count);
-            memcpy((void*)pUB->pBufferViews, ((VkUpdateBuffers*)pUpdate)->pBufferViews, array_size);
-            break;
-        case VK_STRUCTURE_TYPE_UPDATE_AS_COPY:
-            pUAC = new VkUpdateAsCopy;
-            pUpdate = (GENERIC_HEADER*)pUAC;
-            memcpy(pUAC, pUpdate, sizeof(VkUpdateAsCopy));
+        case VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET:
+            pCDS = new VkCopyDescriptorSet;
+            pUpdate = (GENERIC_HEADER*)pCDS;
+            memcpy(pCDS, pUpdate, sizeof(VkCopyDescriptorSet));
             break;
         default:
             sprintf(str, "Unexpected UPDATE struct of type %s (value %u) in vkUpdateDescriptors() struct tree", string_VkStructureType(pUpdate->sType), pUpdate->sType);
@@ -791,19 +728,28 @@ static GENERIC_HEADER* shadowUpdateNode(GENERIC_HEADER* pUpdate)
     pNewNode->pNext = NULL;
     return pNewNode;
 }
-// For given ds, update its mapping based on ppUpdateArray
-static bool32_t dsUpdate(VkDescriptorSet ds, uint32_t updateCount, const void** ppUpdateArray)
+// update DS mappings based on ppUpdateArray
+static bool32_t dsUpdate(VkStructureType type, uint32_t updateCount, const void* pUpdateArray)
 {
+    const VkWriteDescriptorSet *pWDS = NULL;
+    const VkCopyDescriptorSet *pCDS = NULL;
     bool32_t result = 1;
-    SET_NODE* pSet = getSetNode(ds);
+
+    if (type == VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET)
+        pWDS = (const VkWriteDescriptorSet *) pUpdateArray;
+    else
+        pCDS = (const VkCopyDescriptorSet *) pUpdateArray;
+
     loader_platform_thread_lock_mutex(&globalLock);
-    g_lastBoundDescriptorSet = pSet->set;
     LAYOUT_NODE* pLayout = NULL;
     VkDescriptorSetLayoutCreateInfo* pLayoutCI = NULL;
     // TODO : If pCIList is NULL, flag error
     // Perform all updates
     for (uint32_t i = 0; i < updateCount; i++) {
-        GENERIC_HEADER* pUpdate = (GENERIC_HEADER*)ppUpdateArray[i];
+        VkDescriptorSet ds = (pWDS) ? pWDS->destSet : pCDS->destSet;
+        SET_NODE* pSet = setMap[ds]; // getSetNode() without locking
+        g_lastBoundDescriptorSet = pSet->set;
+        GENERIC_HEADER* pUpdate = (pWDS) ? (GENERIC_HEADER*) &pWDS[i] : (GENERIC_HEADER*) &pCDS[i];
         pLayout = pSet->pLayout;
         // First verify valid update struct
         if (!validUpdateStruct(pUpdate)) {
@@ -876,40 +822,17 @@ static void freeShadowUpdateTree(SET_NODE* pSet)
         pFreeUpdate = pShadowUpdate;
         pShadowUpdate = (GENERIC_HEADER*)pShadowUpdate->pNext;
         uint32_t index = 0;
-        VkUpdateSamplers* pUS = NULL;
-        VkUpdateSamplerTextures* pUST = NULL;
-        VkUpdateImages* pUI = NULL;
-        VkUpdateBuffers* pUB = NULL;
+        VkWriteDescriptorSet * pWDS = NULL;
+        VkCopyDescriptorSet * pCDS = NULL;
         void** ppToFree = NULL;
         switch (pFreeUpdate->sType)
         {
-            case VK_STRUCTURE_TYPE_UPDATE_SAMPLERS:
-                pUS = (VkUpdateSamplers*)pFreeUpdate;
-                if (pUS->pSamplers)
-                    delete[] pUS->pSamplers;
-                break;
-            case VK_STRUCTURE_TYPE_UPDATE_SAMPLER_TEXTURES:
-                pUST = (VkUpdateSamplerTextures*)pFreeUpdate;
-                if (pUST->pSamplerImageViews) {
-                    for (index = 0; index < pUST->count; index++) {
-                        if (pUST->pSamplerImageViews[index].pImageView) {
-                            delete pUST->pSamplerImageViews[index].pImageView;
-                        }
-                    }
-                    delete[] pUST->pSamplerImageViews;
-                }
-                break;
-            case VK_STRUCTURE_TYPE_UPDATE_IMAGES:
-                pUI = (VkUpdateImages*)pFreeUpdate;
-                if (pUI->pImageViews)
-                    delete[] pUI->pImageViews;
+            case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET:
+                pWDS = (VkWriteDescriptorSet*)pFreeUpdate;
+                if (pWDS->pDescriptors)
+                    delete[] pWDS->pDescriptors;
                 break;
-            case VK_STRUCTURE_TYPE_UPDATE_BUFFERS:
-                pUB = (VkUpdateBuffers*)pFreeUpdate;
-                if (pUB->pBufferViews)
-                    delete[] pUB->pBufferViews;
-                break;
-            case VK_STRUCTURE_TYPE_UPDATE_AS_COPY:
+            case VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET:
                 break;
             default:
                 assert(0);
@@ -1104,6 +1027,7 @@ static void printPipeline(const VkCmdBuffer cb)
 // Common Dot dumping code
 static void dsCoreDumpDot(const VkDescriptorSet ds, FILE* pOutFile)
 {
+#if 0
     SET_NODE* pSet = getSetNode(ds);
     if (pSet) {
         POOL_NODE* pPool = getPoolNode(pSet->pool);
@@ -1226,6 +1150,7 @@ static void dsCoreDumpDot(const VkDescriptorSet ds, FILE* pOutFile)
         fprintf(pOutFile, "}\n");
         fprintf(pOutFile, "}\n");
     }
+#endif
 }
 // Dump subgraph w/ DS info
 static void dsDumpDot(const VkCmdBuffer cb, FILE* pOutFile)
@@ -1859,14 +1784,13 @@ VK_LAYER_EXPORT void VKAPI vkClearDescriptorSets(VkDevice device, VkDescriptorPo
     nextTable.ClearDescriptorSets(device, descriptorPool, count, pDescriptorSets);
 }
 
-VK_LAYER_EXPORT void VKAPI vkUpdateDescriptors(VkDevice device, VkDescriptorSet descriptorSet, uint32_t updateCount, const void** ppUpdateArray)
+VK_LAYER_EXPORT VkResult VKAPI vkUpdateDescriptorSets(VkDevice device, uint32_t writeCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t copyCount, const VkCopyDescriptorSet* pDescriptorCopies)
 {
-    SET_NODE* pSet = getSetNode(descriptorSet);
-
-    // pUpdateChain is an array of VK_UPDATE_* struct ptrs defining the mappings for the descriptors
-    if (dsUpdate(descriptorSet, updateCount, ppUpdateArray)) {
-        nextTable.UpdateDescriptors(device, descriptorSet, updateCount, ppUpdateArray);
-    }
+    if (dsUpdate(VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, writeCount, pDescriptorWrites) &&
+        dsUpdate(VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET, copyCount, pDescriptorCopies))
+        return nextTable.UpdateDescriptorSets(device, writeCount, pDescriptorWrites, copyCount, pDescriptorCopies);
+    else
+        return VK_ERROR_UNKNOWN;
 }
 
 VK_LAYER_EXPORT VkResult VKAPI vkCreateDynamicViewportState(VkDevice device, const VkDynamicVpStateCreateInfo* pCreateInfo, VkDynamicVpState* pState)
@@ -2761,8 +2685,8 @@ VK_LAYER_EXPORT void* VKAPI vkGetProcAddr(VkPhysicalDevice gpu, const char* func
         return (void*) vkAllocDescriptorSets;
     if (!strcmp(funcName, "vkClearDescriptorSets"))
         return (void*) vkClearDescriptorSets;
-    if (!strcmp(funcName, "vkUpdateDescriptors"))
-        return (void*) vkUpdateDescriptors;
+    if (!strcmp(funcName, "vkUpdateDescriptorSets"))
+        return (void*) vkUpdateDescriptorSets;
     if (!strcmp(funcName, "vkCreateDynamicViewportState"))
         return (void*) vkCreateDynamicViewportState;
     if (!strcmp(funcName, "vkCreateDynamicRasterState"))
index 1915e713bee2405dfd8c6d536590f9097cfbb313..a7b0a20276be869502310597d2379dbd275e5884 100644 (file)
@@ -108,13 +108,13 @@ typedef struct _SAMPLER_NODE {
 typedef struct _IMAGE_NODE {
     VkImageView             image;
     VkImageViewCreateInfo createInfo;
-    VkImageViewAttachInfo attachInfo;
+    VkDescriptorInfo descriptorInfo;
 } IMAGE_NODE;
 
 typedef struct _BUFFER_NODE {
     VkBufferView             buffer;
     VkBufferViewCreateInfo createInfo;
-    VkBufferViewAttachInfo attachInfo;
+    VkDescriptorInfo descriptorInfo;
 } BUFFER_NODE;
 
 typedef struct _DYNAMIC_STATE_NODE {
index 1c15544ad4b207de9b114849600ad0355f396517..358fb99105ec0c718c8c56eda9974e4589968f31 100644 (file)
@@ -1144,14 +1144,6 @@ VK_LAYER_EXPORT void VKAPI vkClearDescriptorSets(VkDevice device, VkDescriptorPo
     nextTable.ClearDescriptorSets(device, descriptorPool, count, pDescriptorSets);
 }
 
-VK_LAYER_EXPORT void VKAPI vkUpdateDescriptors(VkDevice device, VkDescriptorSet descriptorSet, uint32_t updateCount, const void** ppUpdateArray)
-{
-    loader_platform_thread_lock_mutex(&objLock);
-    ll_increment_use_count((void*)descriptorSet, VK_OBJECT_TYPE_DESCRIPTOR_SET);
-    loader_platform_thread_unlock_mutex(&objLock);
-    nextTable.UpdateDescriptors(device, descriptorSet, updateCount, ppUpdateArray);
-}
-
 VK_LAYER_EXPORT VkResult VKAPI vkCreateDynamicViewportState(VkDevice device, const VkDynamicVpStateCreateInfo* pCreateInfo, VkDynamicVpState* pState)
 {
     loader_platform_thread_lock_mutex(&objLock);
index 2ee5d7842e1d16613876717b7849c3847686f0f8..f91518dc1e6caf6889566b25e45ed09d15e878d3 100644 (file)
@@ -1034,10 +1034,10 @@ VK_LAYER_EXPORT void VKAPI vkClearDescriptorSets(VkDevice device, VkDescriptorPo
     nextTable.ClearDescriptorSets(device, descriptorPool, count, pDescriptorSets);
 }
 
-VK_LAYER_EXPORT void VKAPI vkUpdateDescriptors(VkDevice device, VkDescriptorSet descriptorSet, uint32_t updateCount, const void** ppUpdateArray)
+VK_LAYER_EXPORT VkResult VKAPI vkUpdateDescriptorSets(VkDevice device, uint32_t writeCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t copyCount, const VkCopyDescriptorSet* pDescriptorCopies)
 {
 
-    nextTable.UpdateDescriptors(device, descriptorSet, updateCount, ppUpdateArray);
+    return nextTable.UpdateDescriptorSets(device, writeCount, pDescriptorWrites, copyCount, pDescriptorCopies);
 }
 
 VK_LAYER_EXPORT VkResult VKAPI vkCreateDynamicViewportState(VkDevice device, const VkDynamicVpStateCreateInfo* pCreateInfo, VkDynamicVpState* pState)
index 28c10cfbe195d2cc4b0f2a094354413c8ac1c58f..eb8d1fbbe0f5527c23570ece4e26b8fa613e8b08 100644 (file)
@@ -166,8 +166,8 @@ static inline void* globalGetProcAddr(const char *name)
         return (void*) vkAllocDescriptorSets;
     if (!strcmp(name, "ClearDescriptorSets"))
         return (void*) vkClearDescriptorSets;
-    if (!strcmp(name, "UpdateDescriptors"))
-        return (void*) vkUpdateDescriptors;
+    if (!strcmp(name, "UpdateDescriptorSets"))
+        return (void*) vkUpdateDescriptorSets;
     if (!strcmp(name, "CreateDynamicViewportState"))
         return (void*) vkCreateDynamicViewportState;
     if (!strcmp(name, "CreateDynamicRasterState"))
index 49107bb82d9b03c87c06182f2c5cd8fa15773815..37e3774d97e0837a74dc2466fcdd7d75ad02eb47 100644 (file)
@@ -99,7 +99,7 @@ static inline void loader_initialize_dispatch_table(VkLayerDispatchTable *table,
     table->ResetDescriptorPool = (PFN_vkResetDescriptorPool) gpa(gpu, "vkResetDescriptorPool");
     table->AllocDescriptorSets = (PFN_vkAllocDescriptorSets) gpa(gpu, "vkAllocDescriptorSets");
     table->ClearDescriptorSets = (PFN_vkClearDescriptorSets) gpa(gpu, "vkClearDescriptorSets");
-    table->UpdateDescriptors = (PFN_vkUpdateDescriptors) gpa(gpu, "vkUpdateDescriptors");
+    table->UpdateDescriptorSets = (PFN_vkUpdateDescriptorSets) gpa(gpu, "vkUpdateDescriptorSets");
     table->CreateDynamicViewportState = (PFN_vkCreateDynamicViewportState) gpa(gpu, "vkCreateDynamicViewportState");
     table->CreateDynamicRasterState = (PFN_vkCreateDynamicRasterState) gpa(gpu, "vkCreateDynamicRasterState");
     table->CreateDynamicColorBlendState = (PFN_vkCreateDynamicColorBlendState) gpa(gpu, "vkCreateDynamicColorBlendState");
@@ -300,8 +300,8 @@ static inline void *loader_lookup_dispatch_table(const VkLayerDispatchTable *tab
         return (void *) table->AllocDescriptorSets;
     if (!strcmp(name, "ClearDescriptorSets"))
         return (void *) table->ClearDescriptorSets;
-    if (!strcmp(name, "UpdateDescriptors"))
-        return (void *) table->UpdateDescriptors;
+    if (!strcmp(name, "UpdateDescriptorSets"))
+        return (void *) table->UpdateDescriptorSets;
     if (!strcmp(name, "CreateDynamicViewportState"))
         return (void *) table->CreateDynamicViewportState;
     if (!strcmp(name, "CreateDynamicRasterState"))
index d07be991174987e0641c1985929799e051e617d6..082a5c2f39baf3d6e5d20a78ae9968a913a48be9 100644 (file)
@@ -602,13 +602,13 @@ LOADER_EXPORT void VKAPI vkClearDescriptorSets(VkDevice device, VkDescriptorPool
     disp->ClearDescriptorSets(device, descriptorPool, count, pDescriptorSets);
 }
 
-LOADER_EXPORT void VKAPI vkUpdateDescriptors(VkDevice device, VkDescriptorSet descriptorSet, uint32_t updateCount, const void** ppUpdateArray)
+LOADER_EXPORT VkResult VKAPI vkUpdateDescriptorSets(VkDevice device, uint32_t writeCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t copyCount, const VkCopyDescriptorSet* pDescriptorCopies)
 {
     const VkLayerDispatchTable *disp;
 
     disp = loader_get_dispatch(device);
 
-    disp->UpdateDescriptors(device, descriptorSet, updateCount, ppUpdateArray);
+    return disp->UpdateDescriptorSets(device, writeCount, pDescriptorWrites, copyCount, pDescriptorCopies);
 }
 
 LOADER_EXPORT VkResult VKAPI vkCreateDynamicViewportState(VkDevice device, const VkDynamicVpStateCreateInfo* pCreateInfo, VkDynamicVpState* pState)
index a01e30e01782ad185073a3bc9292de536e5bd5e7..2d92c89e34cbf02f87d7b9cc66a31370fec5be77 100644 (file)
@@ -93,7 +93,6 @@ EXPORTS
    vkResetDescriptorPool
    vkAllocDescriptorSets
    vkClearDescriptorSets
-   vkUpdateDescriptors
    vkCreateDynamicViewportState
    vkCreateDynamicRasterState
    vkCreateDynamicColorBlendState
index c173fc1388dd4908e908fa0b4a257f3aca547417..f18ab681043ad161520a7431b8da330e04d3dd0c 100755 (executable)
--- a/vulkan.py
+++ b/vulkan.py
@@ -583,11 +583,12 @@ core = Extension(
              Param("uint32_t", "count"),
              Param("const VkDescriptorSet*", "pDescriptorSets")]),
 
-        Proto("void", "UpdateDescriptors",
+        Proto("VkResult", "UpdateDescriptorSets",
             [Param("VkDevice", "device"),
-             Param("VkDescriptorSet", "descriptorSet"),
-             Param("uint32_t", "updateCount"),
-             Param("const void**", "ppUpdateArray")]),
+             Param("uint32_t", "writeCount"),
+             Param("const VkWriteDescriptorSet*", "pDescriptorWrites"),
+             Param("uint32_t", "copyCount"),
+             Param("const VkCopyDescriptorSet*", "pDescriptorCopies")]),
 
         Proto("VkResult", "CreateDynamicViewportState",
             [Param("VkDevice", "device"),