src/sksl/codegen/SkSLWGSLCodeGenerator.cpp
std::string to_wgsl_type(const Type& type) {
    // TODO(skia:13092): Handle array, matrix, sampler types.
    switch (type.typeKind()) {
        case Type::TypeKind::kScalar:
            return std::string(to_scalar_type(type));
        case Type::TypeKind::kVector:
            return "vec" + std::to_string(type.columns()) + "<" +
                   std::string(to_scalar_type(type.componentType())) + ">";
        default:
            break;
    }
    return std::string(type.name());
}
// Convert a SkSL type to a WGSL type. Handles all plain types except structure types
// (see https://www.w3.org/TR/WGSL/#plain-types-section).
Convert a SkSL type to a WGSL type. Handles all plain types except structure types
.
Convert a SkSL type to a WGSL type . Handles all plain types except structure types .
std::string to_wgsl_type(const Type& type) {
    switch (type.typeKind()) {
        case Type::TypeKind::kScalar:
            return std::string(to_scalar_type(type));
        case Type::TypeKind::kVector:
            return "vec" + std::to_string(type.columns()) + "<" +
                   std::string(to_scalar_type(type.componentType())) + ">";
        default:
            break;
    }
    return std::string(type.name());
}
std :: string to_wgsl_type ( const Type & type ) { switch ( type . typeKind ( ) ) { case Type :: TypeKind :: kScalar : return std :: string ( to_scalar_type ( type ) ) ; case Type :: TypeKind :: kVector : return " " + std :: to_string ( type . columns ( ) ) + " " + std :: string ( to_scalar_type ( type . componentType ( ) ) ) + " " ; default : break ; } return std :: string ( type . name ( ) ) ; }
Convert a SkSL type to a WGSL type.
Convert a SkSL type to a WGSL type .
// TODO(skia:13092): Handle array, matrix, sampler types.