layers: Correctly track pSetBindPoints per stage in DrawState layer
diff --git a/layers/draw_state.c b/layers/draw_state.c
index 0fa5b7c..615eaa4 100644
--- a/layers/draw_state.c
+++ b/layers/draw_state.c
@@ -1547,6 +1547,13 @@
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
diff --git a/layers/draw_state.h b/layers/draw_state.h
index 7e0eda8..c247b95 100644
--- a/layers/draw_state.h
+++ b/layers/draw_state.h
@@ -111,7 +111,7 @@
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