void BlockLayoutEncoder::encodeType(GLenum type, unsigned int arraySize, bool isRowMajorMatrix) { int arrayStride; int matrixStride; getBlockLayoutInfo(type, arraySize, isRowMajorMatrix, &arrayStride, &matrixStride); const BlockMemberInfo memberInfo(mCurrentOffset * BytesPerComponent, arrayStride * BytesPerComponent, matrixStride * BytesPerComponent, isRowMajorMatrix); if (mBlockInfoOut) { mBlockInfoOut->push_back(memberInfo); } advanceOffset(type, arraySize, isRowMajorMatrix, arrayStride, matrixStride); }
BlockMemberInfo BlockLayoutEncoder::encodeType(GLenum type, unsigned int arraySize, bool isRowMajorMatrix) { int arrayStride; int matrixStride; getBlockLayoutInfo(type, arraySize, isRowMajorMatrix, &arrayStride, &matrixStride); const BlockMemberInfo memberInfo(static_cast<int>(mCurrentOffset * BytesPerComponent), static_cast<int>(arrayStride * BytesPerComponent), static_cast<int>(matrixStride * BytesPerComponent), isRowMajorMatrix); advanceOffset(type, arraySize, isRowMajorMatrix, arrayStride, matrixStride); return memberInfo; }
void BlockLayoutEncoder::encodeInterfaceBlockField(const InterfaceBlockField &field) { int arrayStride; int matrixStride; ASSERT(field.fields.empty()); getBlockLayoutInfo(field.type, field.arraySize, field.isRowMajorMatrix, &arrayStride, &matrixStride); const BlockMemberInfo memberInfo(mCurrentOffset * BytesPerComponent, arrayStride * BytesPerComponent, matrixStride * BytesPerComponent, field.isRowMajorMatrix); if (mBlockInfoOut) { mBlockInfoOut->push_back(memberInfo); } advanceOffset(field.type, field.arraySize, field.isRowMajorMatrix, arrayStride, matrixStride); }