layers: Correctly track pSetBindPoints per stage in DrawState layer
authorTobin Ehlis <tobin@lunarg.com>
Mon, 16 Feb 2015 21:29:30 +0000 (14:29 -0700)
committerTobin Ehlis <tobin@lunarg.com>
Wed, 18 Feb 2015 23:23:54 +0000 (16:23 -0700)
layers/draw_state.c
layers/draw_state.h

index 0fa5b7c..615eaa4 100644 (file)
@@ -1547,6 +1547,13 @@ XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateDescriptorSetLayout(XGL_DEVICE devic
             memcpy((void*)pNewNode->pCreateInfoList, pSetLayoutInfoList, sizeof(XGL_DESCRIPTOR_SET_LAYOUT_CREATE_INFO));
         pNewNode->layout = *pSetLayout;
         pNewNode->stageFlags = stageFlags;
+        uint32_t i = XGL_SHADER_STAGE_COMPUTE;
+        for (uint32_t stage = XGL_SHADER_STAGE_FLAGS_COMPUTE_BIT; stage > 0; stage >>= 1) {
+            assert(i < XGL_NUM_SHADER_STAGE);
+            if (stage & stageFlags)
+                pNewNode->shaderStageBindPoints[i] = pSetBindPoints[i];
+            i--;
+        }
         pNewNode->startIndex = 0;
         LAYOUT_NODE* pPriorNode = getLayoutNode(priorSetLayout);
         // Point to prior node or NULL if no prior node
index 7e0eda8..c247b95 100644 (file)
@@ -111,7 +111,7 @@ typedef struct _DYNAMIC_STATE_NODE {
 typedef struct _LAYOUT_NODE {
     XGL_DESCRIPTOR_SET_LAYOUT                    layout;
     XGL_FLAGS                                    stageFlags;
-    const uint32_t                               shaderStageBindPoints[XGL_NUM_SHADER_STAGE];
+    uint32_t                                     shaderStageBindPoints[XGL_NUM_SHADER_STAGE];
     const XGL_DESCRIPTOR_SET_LAYOUT_CREATE_INFO* pCreateInfoList;
     uint32_t                                     startIndex; // 1st index of this layout
     uint32_t                                     endIndex; // last index of this layout