lib/src/vulkan/glslang/glslang/MachineIndependent/linkValidate.cpp
// Recursively merge the implicit array sizes through the objects' respective type trees.
Recursively merge the implicit array sizes through the objects' respective type trees.
Recursively merge the implicit array sizes through the objects ' respective type trees .
void TIntermediate::mergeImplicitArraySizes(TType& type, const TType& unitType)
{
    if (type.isImplicitlySizedArray() && unitType.isArray()) {
        int newImplicitArraySize = unitType.isImplicitlySizedArray() ? unitType.getImplicitArraySize() : unitType.getOuterArraySize();
        if (newImplicitArraySize > type.getImplicitArraySize ())
            type.setImplicitArraySize(newImplicitArraySize);
    }
    if (! type.isStruct() || ! unitType.isStruct() || type.getStruct()->size() != unitType.getStruct()->size())
        return;
    for (int i = 0; i < (int)type.getStruct()->size(); ++i)
        mergeImplicitArraySizes(*(*type.getStruct())[i].type, *(*unitType.getStruct())[i].type);
}
void TIntermediate :: mergeImplicitArraySizes ( TType & type , const TType & unitType ) { if ( type . isImplicitlySizedArray ( ) && unitType . isArray ( ) ) { int newImplicitArraySize = unitType . isImplicitlySizedArray ( ) ? unitType . getImplicitArraySize ( ) : unitType . getOuterArraySize ( ) ; if ( newImplicitArraySize > type . getImplicitArraySize ( ) ) type . setImplicitArraySize ( newImplicitArraySize ) ; } if ( ! type . isStruct ( ) || ! unitType . isStruct ( ) || type . getStruct ( ) -> size ( ) != unitType . getStruct ( ) -> size ( ) ) return ; for ( int i = 0 ; i < ( int ) type . getStruct ( ) -> size ( ) ; ++ i ) mergeImplicitArraySizes ( * ( * type . getStruct ( ) ) [ i ] . type , * ( * unitType . getStruct ( ) ) [ i ] . type ) ; }
Recursively merge the implicit array sizes through the objects' respective type trees.
Recursively merge the implicit array sizes through the objects ' respective type trees .
// Type mismatches are caught and reported after this, just be careful for now.