binding: introduce XGL_DESCRIPTOR_SET_LAYOUT_CHAIN
authorChia-I Wu <olv@lunarg.com>
Thu, 26 Mar 2015 07:27:55 +0000 (15:27 +0800)
committerChia-I Wu <olv@lunarg.com>
Thu, 16 Apr 2015 09:33:27 +0000 (17:33 +0800)
Replace a chain of XGL_DESCRIPTOR_SET_LAYOUT by
XGL_DESCRIPTOR_SET_LAYOUT_CHAIN.  The change also drops
stageFlags/pSetBindPoints, and affects xglUpdateDescriptors().

xglCmdBindDescriptorSet() is not updated yet by this commit, which makes it
impossible to bind multiple sets.

The change also encourages the use of arrays of resources, which we do not
support.

v2: fix a typo in intel_desc_set_update_samplers() that prevents it from
working (olv)

demos/cube.c
demos/tri.c
icd/nulldrv/nulldrv.c
icd/nulldrv/nulldrv.h
include/xgl.h
include/xglDbg.h
include/xglLayer.h
xgl.py

index ea4b12bf7bc36040ce2e0965e759be87865068d7..ffbcffc0ec8125b6e0d5019f49524b3aa010f26f 100644 (file)
@@ -245,6 +245,7 @@ struct demo {
     XGL_CMD_BUFFER cmd;  // Buffer for initialization commands
     XGL_MEMORY_REF mem_refs[16];
     int num_refs;
+    XGL_DESCRIPTOR_SET_LAYOUT_CHAIN desc_layout_chain;
     XGL_DESCRIPTOR_SET_LAYOUT desc_layout;
     XGL_PIPELINE pipeline;
 
@@ -1224,13 +1225,14 @@ static void demo_prepare_descriptor_layout(struct demo *demo)
         .count = 2,
         .pBinding = layout_bindings,
     };
-    const uint32_t bind_point = 0;
     XGL_RESULT err;
 
     err = xglCreateDescriptorSetLayout(demo->device,
-            XGL_SHADER_STAGE_FLAGS_ALL, &bind_point,
-            XGL_NULL_HANDLE, &descriptor_layout,
-            &demo->desc_layout);
+            &descriptor_layout, &demo->desc_layout);
+    assert(!err);
+
+    err = xglCreateDescriptorSetLayoutChain(demo->device,
+            1, &demo->desc_layout, &demo->desc_layout_chain);
     assert(!err);
 }
 
@@ -1379,7 +1381,7 @@ static void demo_prepare_pipeline(struct demo *demo)
 
     memset(&pipeline, 0, sizeof(pipeline));
     pipeline.sType = XGL_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
-    pipeline.lastSetLayout = demo->desc_layout;
+    pipeline.pSetLayoutChain = demo->desc_layout_chain;
 
     memset(&ia, 0, sizeof(ia));
     ia.sType = XGL_STRUCTURE_TYPE_PIPELINE_IA_STATE_CREATE_INFO;
@@ -1543,12 +1545,11 @@ static void demo_prepare_descriptor_pool(struct demo *demo)
 
 static void demo_prepare_descriptor_set(struct demo *demo)
 {
-    const XGL_BUFFER_VIEW_ATTACH_INFO *view_info_vs =
-        &demo->uniform_data.attach;
     XGL_IMAGE_VIEW_ATTACH_INFO view_info[DEMO_TEXTURE_COUNT];
     XGL_SAMPLER_IMAGE_VIEW_INFO combined_info[DEMO_TEXTURE_COUNT];
     XGL_UPDATE_SAMPLER_TEXTURES update_fs;
     XGL_UPDATE_BUFFERS update_vs;
+    const void *update_array[2] = { &update_vs, &update_fs };
     XGL_RESULT err;
     uint32_t count;
     uint32_t i;
@@ -1559,7 +1560,7 @@ static void demo_prepare_descriptor_set(struct demo *demo)
         view_info[i].view = demo->textures[i].view,
         view_info[i].layout = XGL_IMAGE_LAYOUT_GENERAL;
 
-        combined_info[i].pSampler = demo->textures[i].sampler;
+        combined_info[i].sampler = demo->textures[i].sampler;
         combined_info[i].pImageView = &view_info[i];
     }
 
@@ -1568,11 +1569,11 @@ static void demo_prepare_descriptor_set(struct demo *demo)
     update_vs.pNext = &update_fs;
     update_vs.descriptorType = XGL_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
     update_vs.count = 1;
-    update_vs.pBufferViews = &view_info_vs;
+    update_vs.pBufferViews = &demo->uniform_data.attach;
 
     memset(&update_fs, 0, sizeof(update_fs));
     update_fs.sType = XGL_STRUCTURE_TYPE_UPDATE_SAMPLER_TEXTURES;
-    update_fs.index = 1;
+    update_fs.binding = 1;
     update_fs.count = DEMO_TEXTURE_COUNT;
     update_fs.pSamplerImageViews = combined_info;
 
@@ -1586,7 +1587,7 @@ static void demo_prepare_descriptor_set(struct demo *demo)
             XGL_DESCRIPTOR_UPDATE_MODE_FASTEST);
 
     xglClearDescriptorSets(demo->desc_pool, 1, &demo->desc_set);
-    xglUpdateDescriptors(demo->desc_set, &update_vs);
+    xglUpdateDescriptors(demo->desc_set, 2, update_array);
 
     xglEndDescriptorPoolUpdate(demo->device, demo->buffers[demo->current_buffer].cmd);
 }
@@ -1894,6 +1895,7 @@ static void demo_cleanup(struct demo *demo)
     xglDestroyObject(demo->depth_stencil);
 
     xglDestroyObject(demo->pipeline);
+    xglDestroyObject(demo->desc_layout_chain);
     xglDestroyObject(demo->desc_layout);
 
     for (i = 0; i < DEMO_TEXTURE_COUNT; i++) {
index c0591e73b55aa3e6a6cae07dc10c1c9c9a93c67d..d4c36bee49c5c26ab998763317adf098223f41bd 100644 (file)
@@ -80,6 +80,7 @@ struct demo {
     XGL_CMD_BUFFER cmd;  // Buffer for initialization commands
     XGL_MEMORY_REF mem_refs[16];
     int num_refs;
+    XGL_DESCRIPTOR_SET_LAYOUT_CHAIN desc_layout_chain;
     XGL_DESCRIPTOR_SET_LAYOUT desc_layout;
     XGL_PIPELINE pipeline;
 
@@ -857,13 +858,14 @@ static void demo_prepare_descriptor_layout(struct demo *demo)
         .count = 1,
         .pBinding = &layout_binding,
     };
-    const uint32_t bind_point = 0;
     XGL_RESULT err;
 
     err = xglCreateDescriptorSetLayout(demo->device,
-            XGL_SHADER_STAGE_FLAGS_ALL, &bind_point,
-            XGL_NULL_HANDLE, &descriptor_layout,
-            &demo->desc_layout);
+            &descriptor_layout, &demo->desc_layout);
+    assert(!err);
+
+    err = xglCreateDescriptorSetLayoutChain(demo->device,
+            1, &demo->desc_layout, &demo->desc_layout_chain);
     assert(!err);
 }
 
@@ -952,7 +954,7 @@ static void demo_prepare_pipeline(struct demo *demo)
 
     memset(&pipeline, 0, sizeof(pipeline));
     pipeline.sType = XGL_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
-    pipeline.lastSetLayout = demo->desc_layout;
+    pipeline.pSetLayoutChain = demo->desc_layout_chain;
 
     vi = demo->vertices.vi;
 
@@ -1116,6 +1118,7 @@ static void demo_prepare_descriptor_set(struct demo *demo)
     XGL_IMAGE_VIEW_ATTACH_INFO view_info[DEMO_TEXTURE_COUNT];
     XGL_SAMPLER_IMAGE_VIEW_INFO combined_info[DEMO_TEXTURE_COUNT];
     XGL_UPDATE_SAMPLER_TEXTURES update;
+    const void *update_array[1] = { &update };
     XGL_RESULT err;
     uint32_t count;
     uint32_t i;
@@ -1126,7 +1129,7 @@ static void demo_prepare_descriptor_set(struct demo *demo)
         view_info[i].view = demo->textures[i].view,
         view_info[i].layout = XGL_IMAGE_LAYOUT_GENERAL;
 
-        combined_info[i].pSampler = demo->textures[i].sampler;
+        combined_info[i].sampler = demo->textures[i].sampler;
         combined_info[i].pImageView = &view_info[i];
     }
 
@@ -1145,7 +1148,7 @@ static void demo_prepare_descriptor_set(struct demo *demo)
             XGL_DESCRIPTOR_UPDATE_MODE_FASTEST);
 
     xglClearDescriptorSets(demo->desc_pool, 1, &demo->desc_set);
-    xglUpdateDescriptors(demo->desc_set, &update);
+    xglUpdateDescriptors(demo->desc_set, 1, update_array);
 
     xglEndDescriptorPoolUpdate(demo->device, demo->cmd);
 }
@@ -1404,6 +1407,7 @@ static void demo_cleanup(struct demo *demo)
     xglDestroyObject(demo->depth_stencil);
 
     xglDestroyObject(demo->pipeline);
+    xglDestroyObject(demo->desc_layout_chain);
     xglDestroyObject(demo->desc_layout);
 
     xglBindObjectMemory(demo->vertices.buf, 0, XGL_NULL_HANDLE, 0);
index c3c890f373447a47b92b2658aa413cd720107b31..c2ff7330b09dd796469cbbfd09f9fa9237fe5133 100644 (file)
@@ -559,9 +559,6 @@ static XGL_RESULT nulldrv_buf_create(struct nulldrv_dev *dev,
 }
 
 static XGL_RESULT nulldrv_desc_layout_create(struct nulldrv_dev *dev,
-                                    XGL_FLAGS stage_flags,
-                                    const uint32_t *bind_points,
-                                    const struct nulldrv_desc_layout *prior_layout,
                                     const XGL_DESCRIPTOR_SET_LAYOUT_CREATE_INFO *info,
                                     struct nulldrv_desc_layout **layout_ret)
 {
@@ -578,6 +575,24 @@ static XGL_RESULT nulldrv_desc_layout_create(struct nulldrv_dev *dev,
     return XGL_SUCCESS;
 }
 
+static XGL_RESULT nulldrv_desc_layout_chain_create(struct nulldrv_dev *dev,
+                                    uint32_t setLayoutArrayCount,
+                                    const XGL_DESCRIPTOR_SET_LAYOUT *pSetLayoutArray,
+                                    struct nulldrv_desc_layout_chain **chain_ret)
+{
+    struct nulldrv_desc_layout_chain *chain;
+
+    chain = (struct nulldrv_desc_layout_chain *)
+        nulldrv_base_create(dev, sizeof(*chain),
+                XGL_DBG_OBJECT_DESCRIPTOR_SET_LAYOUT_CHAIN);
+    if (!chain)
+        return XGL_ERROR_OUT_OF_MEMORY;
+
+    *chain_ret = chain;
+
+    return XGL_SUCCESS;
+}
+
 static struct nulldrv_desc_layout *nulldrv_desc_layout(XGL_DESCRIPTOR_SET_LAYOUT layout)
 {
     return (struct nulldrv_desc_layout *) layout;
@@ -1884,21 +1899,30 @@ ICD_EXPORT XGL_RESULT XGLAPI xglCreateDepthStencilView(
 
 ICD_EXPORT XGL_RESULT XGLAPI xglCreateDescriptorSetLayout(
     XGL_DEVICE                                   device,
-    XGL_FLAGS                                    stageFlags,
-    const uint32_t*                              pSetBindPoints,
-    XGL_DESCRIPTOR_SET_LAYOUT                    priorSetLayout,
     const XGL_DESCRIPTOR_SET_LAYOUT_CREATE_INFO* pCreateInfo,
     XGL_DESCRIPTOR_SET_LAYOUT*                   pSetLayout)
 {
     NULLDRV_LOG_FUNC;
     struct nulldrv_dev *dev = nulldrv_dev(device);
-    struct nulldrv_desc_layout *prior_layout = nulldrv_desc_layout(priorSetLayout);
 
-    return nulldrv_desc_layout_create(dev, stageFlags, pSetBindPoints,
-            prior_layout, pCreateInfo,
+    return nulldrv_desc_layout_create(dev, pCreateInfo,
             (struct nulldrv_desc_layout **) pSetLayout);
 }
 
+ICD_EXPORT XGL_RESULT XGLAPI xglCreateDescriptorSetLayoutChain(
+    XGL_DEVICE                                   device,
+    uint32_t                                     setLayoutArrayCount,
+    const XGL_DESCRIPTOR_SET_LAYOUT*             pSetLayoutArray,
+    XGL_DESCRIPTOR_SET_LAYOUT_CHAIN*             pLayoutChain)
+{
+    NULLDRV_LOG_FUNC;
+    struct nulldrv_dev *dev = nulldrv_dev(device);
+
+    return nulldrv_desc_layout_chain_create(dev,
+            setLayoutArrayCount, pSetLayoutArray,
+            (struct nulldrv_desc_layout_chain **) pLayoutChain);
+}
+
 ICD_EXPORT XGL_RESULT XGLAPI xglBeginDescriptorPoolUpdate(
     XGL_DEVICE                                   device,
     XGL_DESCRIPTOR_UPDATE_MODE                   updateMode)
@@ -1976,7 +2000,8 @@ ICD_EXPORT void XGLAPI xglClearDescriptorSets(
 
 ICD_EXPORT void XGLAPI xglUpdateDescriptors(
     XGL_DESCRIPTOR_SET                           descriptorSet,
-    const void*                                  pUpdateChain)
+    uint32_t                                     updateCount,
+    const void**                                 ppUpdateArray)
 {
     NULLDRV_LOG_FUNC;
 }
index b398ba34dce1689b1afcac86078369c119f1bdae..28d73bafc7df3302565a41fa65036752ffbda39b 100644 (file)
@@ -143,6 +143,10 @@ struct nulldrv_desc_layout {
     struct nulldrv_obj obj;
 };
 
+struct nulldrv_desc_layout_chain {
+    struct nulldrv_obj obj;
+};
+
 struct nulldrv_shader {
     struct nulldrv_obj obj;
 
index 3b9362f04503b5af62859889a69fd131b9edb2af..78c0faac79db34fc7c24ddad5c56de0cd2e7eb5a 100644 (file)
@@ -72,6 +72,7 @@ XGL_DEFINE_SUBCLASS_HANDLE(XGL_PIPELINE, XGL_OBJECT)
 XGL_DEFINE_SUBCLASS_HANDLE(XGL_SAMPLER, XGL_OBJECT)
 XGL_DEFINE_SUBCLASS_HANDLE(XGL_DESCRIPTOR_SET, XGL_OBJECT)
 XGL_DEFINE_SUBCLASS_HANDLE(XGL_DESCRIPTOR_SET_LAYOUT, XGL_OBJECT)
+XGL_DEFINE_SUBCLASS_HANDLE(XGL_DESCRIPTOR_SET_LAYOUT_CHAIN, XGL_OBJECT)
 XGL_DEFINE_SUBCLASS_HANDLE(XGL_DESCRIPTOR_POOL, XGL_OBJECT)
 XGL_DEFINE_SUBCLASS_HANDLE(XGL_DYNAMIC_STATE_OBJECT, XGL_OBJECT)
 XGL_DEFINE_SUBCLASS_HANDLE(XGL_DYNAMIC_VP_STATE_OBJECT, XGL_DYNAMIC_STATE_OBJECT)
@@ -1523,24 +1524,26 @@ typedef struct _XGL_UPDATE_SAMPLERS
 {
     XGL_STRUCTURE_TYPE                      sType;                      // Must be XGL_STRUCTURE_TYPE_UPDATE_SAMPLERS
     const void*                             pNext;                      // Pointer to next structure
-    uint32_t                                index;
-    uint32_t                                count;
+    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 XGL_SAMPLER*                      pSamplers;
 } XGL_UPDATE_SAMPLERS;
 
 typedef struct _XGL_SAMPLER_IMAGE_VIEW_INFO
 {
-    XGL_SAMPLER                             pSampler;
+    XGL_SAMPLER                             sampler;
     const XGL_IMAGE_VIEW_ATTACH_INFO*       pImageView;
 } XGL_SAMPLER_IMAGE_VIEW_INFO;
 
 typedef struct _XGL_UPDATE_SAMPLER_TEXTURES
 {
-    XGL_STRUCTURE_TYPE                       sType;                     // Must be XGL_STRUCTURE_TYPE_UPDATE_SAMPLER_TEXTURES
-    const void*                              pNext;                     // Pointer to next structure
-    uint32_t                                 index;
-    uint32_t                                 count;
-    const XGL_SAMPLER_IMAGE_VIEW_INFO*       pSamplerImageViews;
+    XGL_STRUCTURE_TYPE                      sType;                      // Must be XGL_STRUCTURE_TYPE_UPDATE_SAMPLER_TEXTURES
+    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 XGL_SAMPLER_IMAGE_VIEW_INFO*      pSamplerImageViews;
 } XGL_UPDATE_SAMPLER_TEXTURES;
 
 typedef struct _XGL_UPDATE_IMAGES
@@ -1548,9 +1551,10 @@ typedef struct _XGL_UPDATE_IMAGES
     XGL_STRUCTURE_TYPE                       sType;                     // Must be XGL_STRUCTURE_TYPE_UPDATE_IMAGES
     const void*                              pNext;                     // Pointer to next structure
     XGL_DESCRIPTOR_TYPE                      descriptorType;
-    uint32_t                                 index;
-    uint32_t                                 count;
-    const XGL_IMAGE_VIEW_ATTACH_INFO* const* pImageViews;
+    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 XGL_IMAGE_VIEW_ATTACH_INFO*        pImageViews;
 } XGL_UPDATE_IMAGES;
 
 typedef struct _XGL_UPDATE_BUFFERS
@@ -1558,9 +1562,10 @@ typedef struct _XGL_UPDATE_BUFFERS
     XGL_STRUCTURE_TYPE                        sType;                    // Must be XGL_STRUCTURE_TYPE_UPDATE_BUFFERS
     const void*                               pNext;                    // Pointer to next structure
     XGL_DESCRIPTOR_TYPE                       descriptorType;
-    uint32_t                                  index;
-    uint32_t                                  count;
-    const XGL_BUFFER_VIEW_ATTACH_INFO* const* pBufferViews;
+    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 XGL_BUFFER_VIEW_ATTACH_INFO*        pBufferViews;
 } XGL_UPDATE_BUFFERS;
 
 typedef struct _XGL_UPDATE_AS_COPY
@@ -1569,7 +1574,8 @@ typedef struct _XGL_UPDATE_AS_COPY
     const void*                             pNext;                      // Pointer to next structure
     XGL_DESCRIPTOR_TYPE                     descriptorType;
     XGL_DESCRIPTOR_SET                      descriptorSet;
-    uint32_t                                descriptorIndex;
+    uint32_t                                binding;
+    uint32_t                                arrayElement;
     uint32_t                                count;
 } XGL_UPDATE_AS_COPY;
 
@@ -1878,7 +1884,12 @@ typedef struct _XGL_COMPUTE_PIPELINE_CREATE_INFO
     const void*                             pNext;      // Pointer to next structure
     XGL_PIPELINE_SHADER                     cs;
     XGL_FLAGS                               flags;      // XGL_PIPELINE_CREATE_FLAGS
-    XGL_DESCRIPTOR_SET_LAYOUT               lastSetLayout;
+    XGL_DESCRIPTOR_SET_LAYOUT_CHAIN         setLayoutChain;
+    // For local size fields zero is treated an invalid value
+    uint32_t                                localSizeX;
+    uint32_t                                localSizeY;
+    uint32_t                                localSizeZ;
+
 } XGL_COMPUTE_PIPELINE_CREATE_INFO;
 
 typedef struct _XGL_VERTEX_INPUT_BINDING_DESCRIPTION
@@ -2020,7 +2031,7 @@ typedef struct _XGL_GRAPHICS_PIPELINE_CREATE_INFO
     XGL_STRUCTURE_TYPE                      sType;      // Must be XGL_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO
     const void*                             pNext;      // Pointer to next structure
     XGL_FLAGS                               flags;      // XGL_PIPELINE_CREATE_FLAGS
-    XGL_DESCRIPTOR_SET_LAYOUT               lastSetLayout;
+    XGL_DESCRIPTOR_SET_LAYOUT_CHAIN         pSetLayoutChain;
 } XGL_GRAPHICS_PIPELINE_CREATE_INFO;
 
 typedef struct _XGL_SAMPLER_CREATE_INFO
@@ -2306,14 +2317,15 @@ typedef XGL_RESULT (XGLAPI *xglStorePipelineType)(XGL_PIPELINE pipeline, size_t*
 typedef XGL_RESULT (XGLAPI *xglLoadPipelineType)(XGL_DEVICE device, size_t dataSize, const void* pData, XGL_PIPELINE* pPipeline);
 typedef XGL_RESULT (XGLAPI *xglLoadPipelineDerivativeType)(XGL_DEVICE device, size_t dataSize, const void* pData, XGL_PIPELINE basePipeline, XGL_PIPELINE* pPipeline);
 typedef XGL_RESULT (XGLAPI *xglCreateSamplerType)(XGL_DEVICE device, const XGL_SAMPLER_CREATE_INFO* pCreateInfo, XGL_SAMPLER* pSampler);
-typedef XGL_RESULT (XGLAPI *xglCreateDescriptorSetLayoutType)(XGL_DEVICE device, XGL_FLAGS stageFlags, const uint32_t* pSetBindPoints, XGL_DESCRIPTOR_SET_LAYOUT priorSetLayout, const XGL_DESCRIPTOR_SET_LAYOUT_CREATE_INFO* pCreateInfo, XGL_DESCRIPTOR_SET_LAYOUT* pSetLayout);
+typedef XGL_RESULT (XGLAPI *xglCreateDescriptorSetLayoutType)(XGL_DEVICE device, const XGL_DESCRIPTOR_SET_LAYOUT_CREATE_INFO* pCreateInfo, XGL_DESCRIPTOR_SET_LAYOUT* pSetLayout);
+typedef XGL_RESULT (XGLAPI *xglCreateDescriptorSetLayoutChainType)(XGL_DEVICE device, uint32_t setLayoutArrayCount, const XGL_DESCRIPTOR_SET_LAYOUT* pSetLayoutArray, XGL_DESCRIPTOR_SET_LAYOUT_CHAIN* pLayoutChain);
 typedef XGL_RESULT (XGLAPI *xglBeginDescriptorPoolUpdateType)(XGL_DEVICE device, XGL_DESCRIPTOR_UPDATE_MODE updateMode);
 typedef XGL_RESULT (XGLAPI *xglEndDescriptorPoolUpdateType)(XGL_DEVICE device, XGL_CMD_BUFFER cmd);
 typedef XGL_RESULT (XGLAPI *xglCreateDescriptorPoolType)(XGL_DEVICE device, XGL_DESCRIPTOR_POOL_USAGE poolUsage, uint32_t maxSets, const XGL_DESCRIPTOR_POOL_CREATE_INFO* pCreateInfo, XGL_DESCRIPTOR_POOL* pDescriptorPool);
 typedef XGL_RESULT (XGLAPI *xglResetDescriptorPoolType)(XGL_DESCRIPTOR_POOL descriptorPool);
 typedef XGL_RESULT (XGLAPI *xglAllocDescriptorSetsType)(XGL_DESCRIPTOR_POOL descriptorPool, XGL_DESCRIPTOR_SET_USAGE setUsage, uint32_t count, const XGL_DESCRIPTOR_SET_LAYOUT* pSetLayouts, XGL_DESCRIPTOR_SET* pDescriptorSets, uint32_t* pCount);
 typedef void       (XGLAPI *xglClearDescriptorSetsType)(XGL_DESCRIPTOR_POOL descriptorPool, uint32_t count, const XGL_DESCRIPTOR_SET* pDescriptorSets);
-typedef void       (XGLAPI *xglUpdateDescriptorsType)(XGL_DESCRIPTOR_SET descriptorSet, const void* pUpdateChain);
+typedef void       (XGLAPI *xglUpdateDescriptorsType)(XGL_DESCRIPTOR_SET descriptorSet, uint32_t updateCount, const void** ppUpdateArray);
 typedef XGL_RESULT (XGLAPI *xglCreateDynamicViewportStateType)(XGL_DEVICE device, const XGL_DYNAMIC_VP_STATE_CREATE_INFO* pCreateInfo, XGL_DYNAMIC_VP_STATE_OBJECT* pState);
 typedef XGL_RESULT (XGLAPI *xglCreateDynamicRasterStateType)(XGL_DEVICE device, const XGL_DYNAMIC_RS_STATE_CREATE_INFO* pCreateInfo, XGL_DYNAMIC_RS_STATE_OBJECT* pState);
 typedef XGL_RESULT (XGLAPI *xglCreateDynamicColorBlendStateType)(XGL_DEVICE device, const XGL_DYNAMIC_CB_STATE_CREATE_INFO* pCreateInfo, XGL_DYNAMIC_CB_STATE_OBJECT* pState);
@@ -2699,12 +2711,15 @@ XGL_RESULT XGLAPI xglCreateSampler(
 
 XGL_RESULT XGLAPI xglCreateDescriptorSetLayout(
     XGL_DEVICE                                   device,
-    XGL_FLAGS                                    stageFlags,            // XGL_SHADER_STAGE_FLAGS
-    const uint32_t*                              pSetBindPoints,
-    XGL_DESCRIPTOR_SET_LAYOUT                    priorSetLayout,
     const XGL_DESCRIPTOR_SET_LAYOUT_CREATE_INFO* pCreateInfo,
     XGL_DESCRIPTOR_SET_LAYOUT*                   pSetLayout);
 
+XGL_RESULT XGLAPI xglCreateDescriptorSetLayoutChain(
+    XGL_DEVICE                                   device,
+    uint32_t                                     setLayoutArrayCount,
+    const XGL_DESCRIPTOR_SET_LAYOUT*             pSetLayoutArray,
+    XGL_DESCRIPTOR_SET_LAYOUT_CHAIN*             pLayoutChain);
+
 XGL_RESULT XGLAPI xglBeginDescriptorPoolUpdate(
     XGL_DEVICE                                   device,
     XGL_DESCRIPTOR_UPDATE_MODE                   updateMode);
@@ -2738,7 +2753,8 @@ void XGLAPI xglClearDescriptorSets(
 
 void XGLAPI xglUpdateDescriptors(
     XGL_DESCRIPTOR_SET                           descriptorSet,
-    const void*                                  pUpdateChain);
+    uint32_t                                     updateCount,
+    const void**                                 ppUpdateArray);
 
 // State object functions
 
index 7e655e65cc4522d9c0be338596185878be3bc197..41b4b3baf7deabb6fcc6256d9ebf536a97d5d06d 100644 (file)
@@ -91,6 +91,7 @@ typedef enum _XGL_DBG_OBJECT_TYPE
     XGL_DBG_OBJECT_BUFFER,
     XGL_DBG_OBJECT_BUFFER_VIEW,
     XGL_DBG_OBJECT_DESCRIPTOR_SET_LAYOUT,
+    XGL_DBG_OBJECT_DESCRIPTOR_SET_LAYOUT_CHAIN,
     XGL_DBG_OBJECT_DESCRIPTOR_POOL,
 
     XGL_DBG_OBJECT_TYPE_BEGIN_RANGE = XGL_DBG_OBJECT_UNKNOWN,
index e4c145a0f6075e329b98b7f5f02e89858972d843..98e52537a336dde892dbda37ea28d24ca83d123d 100644 (file)
@@ -86,6 +86,7 @@ typedef struct _XGL_LAYER_DISPATCH_TABLE
     xglLoadPipelineDerivativeType LoadPipelineDerivative;
     xglCreateSamplerType CreateSampler;
     xglCreateDescriptorSetLayoutType CreateDescriptorSetLayout;
+    xglCreateDescriptorSetLayoutChainType CreateDescriptorSetLayoutChain;
     xglBeginDescriptorPoolUpdateType BeginDescriptorPoolUpdate;
     xglEndDescriptorPoolUpdateType EndDescriptorPoolUpdate;
     xglCreateDescriptorPoolType CreateDescriptorPool;
diff --git a/xgl.py b/xgl.py
index cd7eb0013a97e3a7e483d9301b6e9ab13b896574..f9c6d44f502dd79330c5d96fdea0f3191c45dfcc 100644 (file)
--- a/xgl.py
+++ b/xgl.py
@@ -201,6 +201,7 @@ core = Extension(
         "XGL_SAMPLER",
         "XGL_DESCRIPTOR_SET",
         "XGL_DESCRIPTOR_SET_LAYOUT",
+        "XGL_DESCRIPTOR_SET_LAYOUT_CHAIN",
         "XGL_DESCRIPTOR_POOL",
         "XGL_DYNAMIC_STATE_OBJECT",
         "XGL_DYNAMIC_VP_STATE_OBJECT",
@@ -511,12 +512,15 @@ core = Extension(
 
         Proto("XGL_RESULT", "CreateDescriptorSetLayout",
             [Param("XGL_DEVICE", "device"),
-             Param("XGL_FLAGS", "stageFlags"),
-             Param("const uint32_t*", "pSetBindPoints"),
-             Param("XGL_DESCRIPTOR_SET_LAYOUT", "priorSetLayout"),
              Param("const XGL_DESCRIPTOR_SET_LAYOUT_CREATE_INFO*", "pCreateInfo"),
              Param("XGL_DESCRIPTOR_SET_LAYOUT*", "pSetLayout")]),
 
+        Proto("XGL_RESULT", "CreateDescriptorSetLayoutChain",
+            [Param("XGL_DEVICE", "device"),
+             Param("uint32_t", "setLayoutArrayCount"),
+             Param("const XGL_DESCRIPTOR_SET_LAYOUT*", "pSetLayoutArray"),
+             Param("XGL_DESCRIPTOR_SET_LAYOUT_CHAIN*", "pLayoutChain")]),
+
         Proto("XGL_RESULT", "BeginDescriptorPoolUpdate",
             [Param("XGL_DEVICE", "device"),
              Param("XGL_DESCRIPTOR_UPDATE_MODE", "updateMode")]),
@@ -550,7 +554,8 @@ core = Extension(
 
         Proto("void", "UpdateDescriptors",
             [Param("XGL_DESCRIPTOR_SET", "descriptorSet"),
-             Param("const void*", "pUpdateChain")]),
+             Param("uint32_t", "updateCount"),
+             Param("const void**", "ppUpdateArray")]),
 
         Proto("XGL_RESULT", "CreateDynamicViewportState",
             [Param("XGL_DEVICE", "device"),