pid_enum.append(' {')
pid_enum.append(' total_size_ppEnabledExtensionNames += strlen(pStruct->ppEnabledExtensionNames[i]) + 1;')
pid_enum.append(' }')
- pid_enum.append(' return sizeof(XGL_DEVICE_CREATE_INFO) + (pStruct->queueRecordCount*sizeof(XGL_DEVICE_CREATE_INFO)) + total_size_ppEnabledExtensionNames;')
+ pid_enum.append(' uint64_t total_size_layers = 0;')
+ pid_enum.append(' XGL_LAYER_CREATE_INFO *pNext = ( XGL_LAYER_CREATE_INFO *) pStruct->pNext;')
+ pid_enum.append(' while (pNext != NULL)')
+ pid_enum.append(' {')
+ pid_enum.append(' if ((pNext->sType == XGL_STRUCTURE_TYPE_LAYER_CREATE_INFO) && pNext->layerCount > 0)')
+ pid_enum.append(' {')
+ pid_enum.append(' total_size_layers += sizeof(XGL_LAYER_CREATE_INFO);')
+ pid_enum.append(' for (i = 0; i < pNext->layerCount; i++)')
+ pid_enum.append(' {')
+ pid_enum.append(' total_size_layers += strlen(pNext->ppActiveLayerNames[i]) + 1;')
+ pid_enum.append(' }')
+ pid_enum.append(' }')
+ pid_enum.append(' pNext = ( XGL_LAYER_CREATE_INFO *) pNext->pNext;')
+ pid_enum.append(' }')
+ pid_enum.append(' return sizeof(XGL_DEVICE_CREATE_INFO) + (pStruct->queueRecordCount*sizeof(XGL_DEVICE_CREATE_INFO)) + total_size_ppEnabledExtensionNames + total_size_layers;')
pid_enum.append('}\n')
pid_enum.append('static void add_XGL_DEVICE_CREATE_INFO_to_packet(glv_trace_packet_header* pHeader, XGL_DEVICE_CREATE_INFO** ppStruct, const XGL_DEVICE_CREATE_INFO *pInStruct)')
pid_enum.append('{')
pid_enum.append(' }')
pid_enum.append(' glv_finalize_buffer_address(pHeader, (void **)&(*ppStruct)->ppEnabledExtensionNames);')
pid_enum.append(' }')
+ pid_enum.append(' XGL_LAYER_CREATE_INFO *pNext = ( XGL_LAYER_CREATE_INFO *) pInStruct->pNext;')
+ pid_enum.append(' while (pNext != NULL)')
+ pid_enum.append(' {')
+ pid_enum.append(' if ((pNext->sType == XGL_STRUCTURE_TYPE_LAYER_CREATE_INFO) && pNext->layerCount > 0)')
+ pid_enum.append(' {')
+ pid_enum.append(' glv_add_buffer_to_trace_packet(pHeader, (void**)(&((*ppStruct)->pNext)), sizeof(XGL_LAYER_CREATE_INFO), pNext);')
+ pid_enum.append(' glv_finalize_buffer_address(pHeader, (void**)(&((*ppStruct)->pNext)));')
+ pid_enum.append(' XGL_LAYER_CREATE_INFO **ppOutStruct = (XGL_LAYER_CREATE_INFO **) &((*ppStruct)->pNext);')
+ pid_enum.append(' glv_add_buffer_to_trace_packet(pHeader, (void**)(&(*ppOutStruct)->ppActiveLayerNames), pNext->layerCount * sizeof(XGL_CHAR *), pNext->ppActiveLayerNames);')
+ pid_enum.append(' for (i = 0; i < pNext->layerCount; i++)')
+ pid_enum.append(' {')
+ pid_enum.append(' glv_add_buffer_to_trace_packet(pHeader, (void**)(&((*ppOutStruct)->ppActiveLayerNames[i])), strlen(pNext->ppActiveLayerNames[i]) + 1, pNext->ppActiveLayerNames[i]);')
+ pid_enum.append(' glv_finalize_buffer_address(pHeader, (void**)(&((*ppOutStruct)->ppActiveLayerNames[i])));')
+ pid_enum.append(' }')
+ pid_enum.append(' glv_finalize_buffer_address(pHeader, (void **)&(*ppOutStruct)->ppActiveLayerNames);')
+ pid_enum.append(' }')
+ pid_enum.append(' pNext = ( XGL_LAYER_CREATE_INFO *) pNext->pNext;')
+ pid_enum.append(' }')
pid_enum.append(' glv_finalize_buffer_address(pHeader, (void**)ppStruct);')
pid_enum.append('}\n')
pid_enum.append('static XGL_DEVICE_CREATE_INFO* interpret_XGL_DEVICE_CREATE_INFO(glv_trace_packet_header* pHeader, intptr_t ptr_variable)')
pid_enum.append(' XGL_DEVICE_CREATE_INFO* pXGL_DEVICE_CREATE_INFO = (XGL_DEVICE_CREATE_INFO*)glv_trace_packet_interpret_buffer_pointer(pHeader, (intptr_t)ptr_variable);\n')
pid_enum.append(' if (pXGL_DEVICE_CREATE_INFO != NULL)')
pid_enum.append(' {')
+ pid_enum.append(' uint32_t i;')
+ pid_enum.append(' const XGL_CHAR** pNames;')
pid_enum.append(' pXGL_DEVICE_CREATE_INFO->pRequestedQueues = (const XGL_DEVICE_QUEUE_CREATE_INFO*)glv_trace_packet_interpret_buffer_pointer(pHeader, (intptr_t)pXGL_DEVICE_CREATE_INFO->pRequestedQueues);\n')
pid_enum.append(' if (pXGL_DEVICE_CREATE_INFO->extensionCount > 0)')
pid_enum.append(' {')
- pid_enum.append(' const XGL_CHAR** pNames;')
- pid_enum.append(' uint32_t i;')
pid_enum.append(' pXGL_DEVICE_CREATE_INFO->ppEnabledExtensionNames = (const XGL_CHAR *const*)glv_trace_packet_interpret_buffer_pointer(pHeader, (intptr_t)pXGL_DEVICE_CREATE_INFO->ppEnabledExtensionNames);')
pid_enum.append(' pNames = (const XGL_CHAR**)pXGL_DEVICE_CREATE_INFO->ppEnabledExtensionNames;')
pid_enum.append(' for (i = 0; i < pXGL_DEVICE_CREATE_INFO->extensionCount; i++)')
pid_enum.append(' pNames[i] = (const XGL_CHAR*)glv_trace_packet_interpret_buffer_pointer(pHeader, (intptr_t)(pXGL_DEVICE_CREATE_INFO->ppEnabledExtensionNames[i]));')
pid_enum.append(' }')
pid_enum.append(' }')
+ pid_enum.append(' XGL_LAYER_CREATE_INFO *pNext = ( XGL_LAYER_CREATE_INFO *) glv_trace_packet_interpret_buffer_pointer(pHeader, (intptr_t)pXGL_DEVICE_CREATE_INFO->pNext);')
+ pid_enum.append(' while (pNext != NULL)')
+ pid_enum.append(' {')
+ pid_enum.append(' if ((pNext->sType == XGL_STRUCTURE_TYPE_LAYER_CREATE_INFO) && pNext->layerCount > 0)')
+ pid_enum.append(' {')
+ pid_enum.append(' pNext->ppActiveLayerNames = (const XGL_CHAR**) glv_trace_packet_interpret_buffer_pointer(pHeader, (intptr_t)(pNext->ppActiveLayerNames));')
+ pid_enum.append(' pNames = (const XGL_CHAR**)pNext->ppActiveLayerNames;')
+ pid_enum.append(' for (i = 0; i < pNext->layerCount; i++)')
+ pid_enum.append(' {')
+ pid_enum.append(' pNames[i] = (const XGL_CHAR*)glv_trace_packet_interpret_buffer_pointer(pHeader, (intptr_t)(pNext->ppActiveLayerNames[i]));')
+ pid_enum.append(' }')
+ pid_enum.append(' }')
+ pid_enum.append(' pNext = ( XGL_LAYER_CREATE_INFO *) glv_trace_packet_interpret_buffer_pointer(pHeader, (intptr_t)pNext->pNext);')
+ pid_enum.append(' }')
pid_enum.append(' }\n')
pid_enum.append(' return pXGL_DEVICE_CREATE_INFO;')
pid_enum.append('}\n')