size_t baseBuffAddr = 0;
XGL_UPDATE_BUFFERS* pUBCI;
XGL_UPDATE_IMAGES* pUICI;
+ char str[1024];
switch (pUpdate->sType)
{
case XGL_STRUCTURE_TYPE_UPDATE_SAMPLERS:
memcpy(pNewNode, pUpdate, sizeof(XGL_UPDATE_AS_COPY));
break;
default:
- // TODO : Flag specific error for this case
+ sprintf(str, "Unexpected UPDATE struct of type %s (value %u) in xglUpdateDescriptors() struct tree", string_XGL_STRUCTURE_TYPE(pUpdate->sType), pUpdate->sType);
+ layerCbMsg(XGL_DBG_MSG_ERROR, XGL_VALIDATION_LEVEL_0, NULL, 0, DRAWSTATE_INVALID_UPDATE_STRUCT, "DS", str);
return NULL;
}
// Make sure that pNext for the end of shadow copy is NULL
pNewNode->pNext = NULL;
return pNewNode;
}
-// For given ds, update it's mapping based on pUpdateChain linked-list
+// For given ds, update its mapping based on pUpdateChain linked-list
static void dsUpdate(XGL_DESCRIPTOR_SET ds, GENERIC_HEADER* pUpdateChain)
{
SET_NODE* pSet = getSetNode(ds);
}
loader_platform_thread_unlock_mutex(&globalLock);
}
-// Free a shadowed update node
+// Free the shadowed update node for this Set
// NOTE : Calls to this function should be wrapped in mutex
-static void freeShadowUpdateTree(GENERIC_HEADER* pUpdate)
+static void freeShadowUpdateTree(SET_NODE* pSet)
{
- GENERIC_HEADER* pShadowUpdate = pUpdate;
+ GENERIC_HEADER* pShadowUpdate = pSet->pUpdateStructs;
+ pSet->pUpdateStructs = NULL;
GENERIC_HEADER* pFreeUpdate = pShadowUpdate;
while(pShadowUpdate) {
pFreeUpdate = pShadowUpdate;
pSet = pSet->pNext;
// Freeing layouts handled in freeLayouts() function
// Free Update shadow struct tree
- freeShadowUpdateTree(pFreeSet->pUpdateStructs);
+ freeShadowUpdateTree(pFreeSet);
if (pFreeSet->ppDescriptors) {
#if ALLOC_DEBUG
printf("Free35 #%lu pSet->ppDescriptors addr(%p)\n", ++g_free_count, (void*)pFreeSet->ppDescriptors);
}
else {
loader_platform_thread_lock_mutex(&globalLock);
- freeShadowUpdateTree(pSet->pUpdateStructs);
+ freeShadowUpdateTree(pSet);
loader_platform_thread_unlock_mutex(&globalLock);
}
}
DRAWSTATE_OUT_OF_MEMORY, // malloc failed
DRAWSTATE_DESCRIPTOR_TYPE_MISMATCH, // Type in layout vs. update are not the same
DRAWSTATE_DESCRIPTOR_UPDATE_OUT_OF_BOUNDS, // Descriptors set for update out of bounds for corresponding layout section
- DRAWSTATE_INVALID_UPDATE_INDEX // Index of requested update is invalid for specified descriptors set
+ DRAWSTATE_INVALID_UPDATE_INDEX, // Index of requested update is invalid for specified descriptors set
+ DRAWSTATE_INVALID_UPDATE_STRUCT // Struct in DS Update tree is of invalid type
} DRAW_STATE_ERROR;
typedef enum _DRAW_TYPE