blob: 5deae8e17643a569ab1eae87ce2b28204e2e1780 [file] [log] [blame]
// Copyright 2025 The Dawn & Tint Authors
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
////////////////////////////////////////////////////////////////////////////////
// File generated by 'tools/src/cmd/gen' using the template:
// src/tint/lang/core/enums_test.cc.tmpl
//
// To regenerate run: './tools/run gen'
//
// Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////
// clang-format off
#include "src/tint/lang/core/enums.h"
#include <gtest/gtest.h>
#include <string>
#include "src/tint/utils/text/string.h"
namespace tint::core {
namespace {
namespace parse_print_tests {
struct AccessCase {
const char* string;
Access value;
};
inline std::ostream& operator<<(std::ostream& out, AccessCase c) {
return out << "'" << std::string(c.string) << "'";
}
static constexpr AccessCase kValidAccessCases[] = {
{"read", Access::kRead},
{"read_write", Access::kReadWrite},
{"write", Access::kWrite},
};
static constexpr AccessCase kInvalidAccessCases[] = {
{"ccad", Access::kUndefined},
{"3", Access::kUndefined},
{"rVad", Access::kUndefined},
{"read1write", Access::kUndefined},
{"reaJqqrite", Access::kUndefined},
{"rea7ll_write", Access::kUndefined},
{"wrqHtpp", Access::kUndefined},
{"ve", Access::kUndefined},
{"Grbe", Access::kUndefined},
};
using AccessParseTest = testing::TestWithParam<AccessCase>;
TEST_P(AccessParseTest, Parse) {
const char* string = GetParam().string;
Access expect = GetParam().value;
EXPECT_EQ(expect, ParseAccess(string));
}
INSTANTIATE_TEST_SUITE_P(ValidAccessCases, AccessParseTest, testing::ValuesIn(kValidAccessCases));
INSTANTIATE_TEST_SUITE_P(InvalidAccessCases, AccessParseTest, testing::ValuesIn(kInvalidAccessCases));
using AccessPrintTest = testing::TestWithParam<AccessCase>;
TEST_P(AccessPrintTest, Print) {
Access value = GetParam().value;
const char* expect = GetParam().string;
EXPECT_EQ(expect, ToString(value));
}
INSTANTIATE_TEST_SUITE_P(ValidAccessCases, AccessPrintTest, testing::ValuesIn(kValidAccessCases));
} // namespace parse_print_tests
namespace parse_print_tests {
struct AddressSpaceCase {
const char* string;
AddressSpace value;
};
inline std::ostream& operator<<(std::ostream& out, AddressSpaceCase c) {
return out << "'" << std::string(c.string) << "'";
}
static constexpr AddressSpaceCase kValidAddressSpaceCases[] = {
{"function", AddressSpace::kFunction},
{"immediate", AddressSpace::kImmediate},
{"pixel_local", AddressSpace::kPixelLocal},
{"private", AddressSpace::kPrivate},
{"storage", AddressSpace::kStorage},
{"uniform", AddressSpace::kUniform},
{"workgroup", AddressSpace::kWorkgroup},
};
static constexpr AddressSpaceCase kInvalidAddressSpaceCases[] = {
{"fuviition", AddressSpace::kUndefined},
{"fuWWcti8n", AddressSpace::kUndefined},
{"fxxcMion", AddressSpace::kUndefined},
{"iXediggte", AddressSpace::kUndefined},
{"immXVue", AddressSpace::kUndefined},
{"3mmediate", AddressSpace::kUndefined},
{"pixel_locaE", AddressSpace::kUndefined},
{"piTTel_locPl", AddressSpace::kUndefined},
{"pxxdxel_loal", AddressSpace::kUndefined},
{"p44ivate", AddressSpace::kUndefined},
{"prSSvaVVe", AddressSpace::kUndefined},
{"RriR22e", AddressSpace::kUndefined},
{"sFra9e", AddressSpace::kUndefined},
{"stoage", AddressSpace::kUndefined},
{"VOORRHge", AddressSpace::kUndefined},
{"unfoym", AddressSpace::kUndefined},
{"llnnrrf77rm", AddressSpace::kUndefined},
{"unif4r00", AddressSpace::kUndefined},
{"wooogup", AddressSpace::kUndefined},
{"wozzgrop", AddressSpace::kUndefined},
{"o11pkgriiu", AddressSpace::kUndefined},
};
using AddressSpaceParseTest = testing::TestWithParam<AddressSpaceCase>;
TEST_P(AddressSpaceParseTest, Parse) {
const char* string = GetParam().string;
AddressSpace expect = GetParam().value;
EXPECT_EQ(expect, ParseAddressSpace(string));
}
INSTANTIATE_TEST_SUITE_P(ValidAddressSpaceCases, AddressSpaceParseTest, testing::ValuesIn(kValidAddressSpaceCases));
INSTANTIATE_TEST_SUITE_P(InvalidAddressSpaceCases, AddressSpaceParseTest, testing::ValuesIn(kInvalidAddressSpaceCases));
using AddressSpacePrintTest = testing::TestWithParam<AddressSpaceCase>;
TEST_P(AddressSpacePrintTest, Print) {
AddressSpace value = GetParam().value;
const char* expect = GetParam().string;
EXPECT_EQ(expect, ToString(value));
}
INSTANTIATE_TEST_SUITE_P(ValidAddressSpaceCases, AddressSpacePrintTest, testing::ValuesIn(kValidAddressSpaceCases));
} // namespace parse_print_tests
namespace interpolation_sampling_tests {
namespace parse_print_tests {
struct InterpolationSamplingCase {
const char* string;
InterpolationSampling value;
};
inline std::ostream& operator<<(std::ostream& out, InterpolationSamplingCase c) {
return out << "'" << std::string(c.string) << "'";
}
static constexpr InterpolationSamplingCase kValidInterpolationSamplingCases[] = {
{"center", InterpolationSampling::kCenter},
{"centroid", InterpolationSampling::kCentroid},
{"either", InterpolationSampling::kEither},
{"first", InterpolationSampling::kFirst},
{"sample", InterpolationSampling::kSample},
};
static constexpr InterpolationSamplingCase kInvalidInterpolationSamplingCases[] = {
{"ceXXter", InterpolationSampling::kUndefined},
{"55IIntnn99", InterpolationSampling::kUndefined},
{"aHHrrnteSS", InterpolationSampling::kUndefined},
{"ckknod", InterpolationSampling::kUndefined},
{"gjnrRRi", InterpolationSampling::kUndefined},
{"cnbrid", InterpolationSampling::kUndefined},
{"eithjr", InterpolationSampling::kUndefined},
{"ether", InterpolationSampling::kUndefined},
{"ehqr", InterpolationSampling::kUndefined},
{"Nirst", InterpolationSampling::kUndefined},
{"frvv", InterpolationSampling::kUndefined},
{"fisQQ", InterpolationSampling::kUndefined},
{"aplrf", InterpolationSampling::kUndefined},
{"sampje", InterpolationSampling::kUndefined},
{"s82wNNe", InterpolationSampling::kUndefined},
};
using InterpolationSamplingParseTest = testing::TestWithParam<InterpolationSamplingCase>;
TEST_P(InterpolationSamplingParseTest, Parse) {
const char* string = GetParam().string;
InterpolationSampling expect = GetParam().value;
EXPECT_EQ(expect, ParseInterpolationSampling(string));
}
INSTANTIATE_TEST_SUITE_P(ValidInterpolationSamplingCases, InterpolationSamplingParseTest, testing::ValuesIn(kValidInterpolationSamplingCases));
INSTANTIATE_TEST_SUITE_P(InvalidInterpolationSamplingCases, InterpolationSamplingParseTest, testing::ValuesIn(kInvalidInterpolationSamplingCases));
using InterpolationSamplingPrintTest = testing::TestWithParam<InterpolationSamplingCase>;
TEST_P(InterpolationSamplingPrintTest, Print) {
InterpolationSampling value = GetParam().value;
const char* expect = GetParam().string;
EXPECT_EQ(expect, ToString(value));
}
INSTANTIATE_TEST_SUITE_P(ValidInterpolationSamplingCases, InterpolationSamplingPrintTest, testing::ValuesIn(kValidInterpolationSamplingCases));
} // namespace parse_print_tests
} // namespace interpolation_sampling_tests
namespace interpolation_type_tests {
namespace parse_print_tests {
struct InterpolationTypeCase {
const char* string;
InterpolationType value;
};
inline std::ostream& operator<<(std::ostream& out, InterpolationTypeCase c) {
return out << "'" << std::string(c.string) << "'";
}
static constexpr InterpolationTypeCase kValidInterpolationTypeCases[] = {
{"flat", InterpolationType::kFlat},
{"linear", InterpolationType::kLinear},
{"perspective", InterpolationType::kPerspective},
};
static constexpr InterpolationTypeCase kInvalidInterpolationTypeCases[] = {
{"fat", InterpolationType::kUndefined},
{"flrrt", InterpolationType::kUndefined},
{"fGat", InterpolationType::kUndefined},
{"linFFar", InterpolationType::kUndefined},
{"lna", InterpolationType::kUndefined},
{"lrrnea", InterpolationType::kUndefined},
{"persetive", InterpolationType::kUndefined},
{"XrspJJcDive", InterpolationType::kUndefined},
{"pesect8v", InterpolationType::kUndefined},
};
using InterpolationTypeParseTest = testing::TestWithParam<InterpolationTypeCase>;
TEST_P(InterpolationTypeParseTest, Parse) {
const char* string = GetParam().string;
InterpolationType expect = GetParam().value;
EXPECT_EQ(expect, ParseInterpolationType(string));
}
INSTANTIATE_TEST_SUITE_P(ValidInterpolationTypeCases, InterpolationTypeParseTest, testing::ValuesIn(kValidInterpolationTypeCases));
INSTANTIATE_TEST_SUITE_P(InvalidInterpolationTypeCases, InterpolationTypeParseTest, testing::ValuesIn(kInvalidInterpolationTypeCases));
using InterpolationTypePrintTest = testing::TestWithParam<InterpolationTypeCase>;
TEST_P(InterpolationTypePrintTest, Print) {
InterpolationType value = GetParam().value;
const char* expect = GetParam().string;
EXPECT_EQ(expect, ToString(value));
}
INSTANTIATE_TEST_SUITE_P(ValidInterpolationTypeCases, InterpolationTypePrintTest, testing::ValuesIn(kValidInterpolationTypeCases));
} // namespace parse_print_tests
} // namespace interpolation_type_tests
namespace parse_print_tests {
struct TexelFormatCase {
const char* string;
TexelFormat value;
};
inline std::ostream& operator<<(std::ostream& out, TexelFormatCase c) {
return out << "'" << std::string(c.string) << "'";
}
static constexpr TexelFormatCase kValidTexelFormatCases[] = {
{"bgra8unorm", TexelFormat::kBgra8Unorm},
{"r16float", TexelFormat::kR16Float},
{"r16sint", TexelFormat::kR16Sint},
{"r16snorm", TexelFormat::kR16Snorm},
{"r16uint", TexelFormat::kR16Uint},
{"r16unorm", TexelFormat::kR16Unorm},
{"r32float", TexelFormat::kR32Float},
{"r32sint", TexelFormat::kR32Sint},
{"r32uint", TexelFormat::kR32Uint},
{"r8sint", TexelFormat::kR8Sint},
{"r8snorm", TexelFormat::kR8Snorm},
{"r8uint", TexelFormat::kR8Uint},
{"r8unorm", TexelFormat::kR8Unorm},
{"rg11b10ufloat", TexelFormat::kRg11B10Ufloat},
{"rg16float", TexelFormat::kRg16Float},
{"rg16sint", TexelFormat::kRg16Sint},
{"rg16snorm", TexelFormat::kRg16Snorm},
{"rg16uint", TexelFormat::kRg16Uint},
{"rg16unorm", TexelFormat::kRg16Unorm},
{"rg32float", TexelFormat::kRg32Float},
{"rg32sint", TexelFormat::kRg32Sint},
{"rg32uint", TexelFormat::kRg32Uint},
{"rg8sint", TexelFormat::kRg8Sint},
{"rg8snorm", TexelFormat::kRg8Snorm},
{"rg8uint", TexelFormat::kRg8Uint},
{"rg8unorm", TexelFormat::kRg8Unorm},
{"rgb10a2uint", TexelFormat::kRgb10A2Uint},
{"rgb10a2unorm", TexelFormat::kRgb10A2Unorm},
{"rgba16float", TexelFormat::kRgba16Float},
{"rgba16sint", TexelFormat::kRgba16Sint},
{"rgba16snorm", TexelFormat::kRgba16Snorm},
{"rgba16uint", TexelFormat::kRgba16Uint},
{"rgba16unorm", TexelFormat::kRgba16Unorm},
{"rgba32float", TexelFormat::kRgba32Float},
{"rgba32sint", TexelFormat::kRgba32Sint},
{"rgba32uint", TexelFormat::kRgba32Uint},
{"rgba8sint", TexelFormat::kRgba8Sint},
{"rgba8snorm", TexelFormat::kRgba8Snorm},
{"rgba8uint", TexelFormat::kRgba8Uint},
{"rgba8unorm", TexelFormat::kRgba8Unorm},
};
static constexpr TexelFormatCase kInvalidTexelFormatCases[] = {
{"bg811kor", TexelFormat::kUndefined},
{"bgr8unorm", TexelFormat::kUndefined},
{"bgJa8unom", TexelFormat::kUndefined},
{"r16fcoat", TexelFormat::kUndefined},
{"r16floOt", TexelFormat::kUndefined},
{"r16floKK_vtt", TexelFormat::kUndefined},
{"xx8sint", TexelFormat::kUndefined},
{"__q16Fn", TexelFormat::kUndefined},
{"r16qint", TexelFormat::kUndefined},
{"r1633nor6", TexelFormat::kUndefined},
{"rtto6sn9QQm", TexelFormat::kUndefined},
{"r1666nor", TexelFormat::kUndefined},
{"r6Oizz66", TexelFormat::kUndefined},
{"r16uyynt", TexelFormat::kUndefined},
{"Z1HHnZ", TexelFormat::kUndefined},
{"qWW46unrm", TexelFormat::kUndefined},
{"r16OOnrm", TexelFormat::kUndefined},
{"16unoYm", TexelFormat::kUndefined},
{"rloat", TexelFormat::kUndefined},
{"r3fFoat", TexelFormat::kUndefined},
{"w32floa", TexelFormat::kUndefined},
{"fG2iKt", TexelFormat::kUndefined},
{"r32qKint", TexelFormat::kUndefined},
{"r32mmiFt", TexelFormat::kUndefined},
{"32uint", TexelFormat::kUndefined},
{"r2uinq", TexelFormat::kUndefined},
{"r32uibb", TexelFormat::kUndefined},
{"isint", TexelFormat::kUndefined},
{"rOOinq", TexelFormat::kUndefined},
{"r8siTvvt", TexelFormat::kUndefined},
{"r8FFnorm", TexelFormat::kUndefined},
{"P800oQm", TexelFormat::kUndefined},
{"rPsnorm", TexelFormat::kUndefined},
{"rssin77", TexelFormat::kUndefined},
{"r8CiRRbb", TexelFormat::kUndefined},
{"r8uinXX", TexelFormat::kUndefined},
{"q8CCnoOOm", TexelFormat::kUndefined},
{"r8nsrL", TexelFormat::kUndefined},
{"rXunorm", TexelFormat::kUndefined},
{"r11b10ufloat", TexelFormat::kUndefined},
{"g11b10ufqqo", TexelFormat::kUndefined},
{"rg122b10ufloat", TexelFormat::kUndefined},
{"rzzy6Xlo0t", TexelFormat::kUndefined},
{"rP1ifloat", TexelFormat::kUndefined},
{"rg6Cnnoat", TexelFormat::kUndefined},
{"rgqqAAHHn", TexelFormat::kUndefined},
{"g16sint", TexelFormat::kUndefined},
{"rg1fKin", TexelFormat::kUndefined},
{"lgg16snP", TexelFormat::kUndefined},
{"rg6snorm", TexelFormat::kUndefined},
{"4g16cTNorm", TexelFormat::kUndefined},
{"pgl6uin77", TexelFormat::kUndefined},
{"rz1Ngint", TexelFormat::kUndefined},
{"bg16uXXut", TexelFormat::kUndefined},
{"rg16norm", TexelFormat::kUndefined},
{"Q688norK", TexelFormat::kUndefined},
{"rg9unqrm", TexelFormat::kUndefined},
{"rg32flo11t", TexelFormat::kUndefined},
{"rgiiF22oat", TexelFormat::kUndefined},
{"r773float", TexelFormat::kUndefined},
{"rg3NNi2t", TexelFormat::kUndefined},
{"rg32VVint", TexelFormat::kUndefined},
{"WW1132swnF", TexelFormat::kUndefined},
{"rww32uin", TexelFormat::kUndefined},
{"rg32uiDt", TexelFormat::kUndefined},
{"rg32inK", TexelFormat::kUndefined},
{"rg8s1PPht", TexelFormat::kUndefined},
{"rg8snt", TexelFormat::kUndefined},
{"rYY8sint", TexelFormat::kUndefined},
{"kkHHsnVtm", TexelFormat::kUndefined},
{"rg8rrnorm", TexelFormat::kUndefined},
{"rs8snorWW", TexelFormat::kUndefined},
{"Y8uint", TexelFormat::kUndefined},
{"r8uqft", TexelFormat::kUndefined},
{"rgv22uiut", TexelFormat::kUndefined},
{"rgunor", TexelFormat::kUndefined},
{"Yg8norm", TexelFormat::kUndefined},
{"7YEg8unorm", TexelFormat::kUndefined},
{"oog10a2dinM", TexelFormat::kUndefined},
{"rgb0a2uinMM", TexelFormat::kUndefined},
{"rgb10a2uin55", TexelFormat::kUndefined},
{"rb0a2uNorm", TexelFormat::kUndefined},
{"Ogb330a23nrm", TexelFormat::kUndefined},
{"rgb1032unorm", TexelFormat::kUndefined},
{"rgbI6flomt", TexelFormat::kUndefined},
{"rrbK16flnnat", TexelFormat::kUndefined},
{"rba1flXX", TexelFormat::kUndefined},
{"Iga1pLLint", TexelFormat::kUndefined},
{"fb16sint", TexelFormat::kUndefined},
{"UgbRRDsinY", TexelFormat::kUndefined},
{"rgha16snorm", TexelFormat::kUndefined},
{"rba1quunIIr", TexelFormat::kUndefined},
{"rgba16Hnorm", TexelFormat::kUndefined},
{"gbaQQvvint", TexelFormat::kUndefined},
{"66a16uent", TexelFormat::kUndefined},
{"rW7a16uin", TexelFormat::kUndefined},
{"rg0a556unorDD", TexelFormat::kUndefined},
{"rgbH16unIIrm", TexelFormat::kUndefined},
{"rba16unorm", TexelFormat::kUndefined},
{"rba32flort", TexelFormat::kUndefined},
{"rlba32float", TexelFormat::kUndefined},
{"tGgb32loJJt", TexelFormat::kUndefined},
{"rgya3sint", TexelFormat::kUndefined},
{"rba32sint", TexelFormat::kUndefined},
{"IIgbaBB2sint", TexelFormat::kUndefined},
{"33Kb832uinTT", TexelFormat::kUndefined},
{"nngbaYYUUuindSS", TexelFormat::kUndefined},
{"dgba5x2uiZt", TexelFormat::kUndefined},
{"rkkba8sinq", TexelFormat::kUndefined},
{"5bapisin00", TexelFormat::kUndefined},
{"rnnba8siIIt", TexelFormat::kUndefined},
{"ccWbsnoKm", TexelFormat::kUndefined},
{"rgb8snKK", TexelFormat::kUndefined},
{"rgba8sno66m", TexelFormat::kUndefined},
{"rgaKPPuin", TexelFormat::kUndefined},
{"rgxxa8int", TexelFormat::kUndefined},
{"rgbq8uint", TexelFormat::kUndefined},
{"rMba8SSnyyrm", TexelFormat::kUndefined},
{"rgbuunrm", TexelFormat::kUndefined},
{"rgbSnrm", TexelFormat::kUndefined},
};
using TexelFormatParseTest = testing::TestWithParam<TexelFormatCase>;
TEST_P(TexelFormatParseTest, Parse) {
const char* string = GetParam().string;
TexelFormat expect = GetParam().value;
EXPECT_EQ(expect, ParseTexelFormat(string));
}
INSTANTIATE_TEST_SUITE_P(ValidTexelFormatCases, TexelFormatParseTest, testing::ValuesIn(kValidTexelFormatCases));
INSTANTIATE_TEST_SUITE_P(InvalidTexelFormatCases, TexelFormatParseTest, testing::ValuesIn(kInvalidTexelFormatCases));
using TexelFormatPrintTest = testing::TestWithParam<TexelFormatCase>;
TEST_P(TexelFormatPrintTest, Print) {
TexelFormat value = GetParam().value;
const char* expect = GetParam().string;
EXPECT_EQ(expect, ToString(value));
}
INSTANTIATE_TEST_SUITE_P(ValidTexelFormatCases, TexelFormatPrintTest, testing::ValuesIn(kValidTexelFormatCases));
} // namespace parse_print_tests
namespace parse_print_tests {
struct BuiltinTypeCase {
const char* string;
BuiltinType value;
};
inline std::ostream& operator<<(std::ostream& out, BuiltinTypeCase c) {
return out << "'" << std::string(c.string) << "'";
}
static constexpr BuiltinTypeCase kValidBuiltinTypeCases[] = {
{"__atomic_compare_exchange_result_i32", BuiltinType::kAtomicCompareExchangeResultI32},
{"__atomic_compare_exchange_result_u32", BuiltinType::kAtomicCompareExchangeResultU32},
{"__frexp_result_abstract", BuiltinType::kFrexpResultAbstract},
{"__frexp_result_f16", BuiltinType::kFrexpResultF16},
{"__frexp_result_f32", BuiltinType::kFrexpResultF32},
{"__frexp_result_vec2_abstract", BuiltinType::kFrexpResultVec2Abstract},
{"__frexp_result_vec2_f16", BuiltinType::kFrexpResultVec2F16},
{"__frexp_result_vec2_f32", BuiltinType::kFrexpResultVec2F32},
{"__frexp_result_vec3_abstract", BuiltinType::kFrexpResultVec3Abstract},
{"__frexp_result_vec3_f16", BuiltinType::kFrexpResultVec3F16},
{"__frexp_result_vec3_f32", BuiltinType::kFrexpResultVec3F32},
{"__frexp_result_vec4_abstract", BuiltinType::kFrexpResultVec4Abstract},
{"__frexp_result_vec4_f16", BuiltinType::kFrexpResultVec4F16},
{"__frexp_result_vec4_f32", BuiltinType::kFrexpResultVec4F32},
{"__modf_result_abstract", BuiltinType::kModfResultAbstract},
{"__modf_result_f16", BuiltinType::kModfResultF16},
{"__modf_result_f32", BuiltinType::kModfResultF32},
{"__modf_result_vec2_abstract", BuiltinType::kModfResultVec2Abstract},
{"__modf_result_vec2_f16", BuiltinType::kModfResultVec2F16},
{"__modf_result_vec2_f32", BuiltinType::kModfResultVec2F32},
{"__modf_result_vec3_abstract", BuiltinType::kModfResultVec3Abstract},
{"__modf_result_vec3_f16", BuiltinType::kModfResultVec3F16},
{"__modf_result_vec3_f32", BuiltinType::kModfResultVec3F32},
{"__modf_result_vec4_abstract", BuiltinType::kModfResultVec4Abstract},
{"__modf_result_vec4_f16", BuiltinType::kModfResultVec4F16},
{"__modf_result_vec4_f32", BuiltinType::kModfResultVec4F32},
{"array", BuiltinType::kArray},
{"atomic", BuiltinType::kAtomic},
{"binding_array", BuiltinType::kBindingArray},
{"bool", BuiltinType::kBool},
{"buffer", BuiltinType::kBuffer},
{"f16", BuiltinType::kF16},
{"f32", BuiltinType::kF32},
{"i32", BuiltinType::kI32},
{"i8", BuiltinType::kI8},
{"input_attachment", BuiltinType::kInputAttachment},
{"mat2x2", BuiltinType::kMat2X2},
{"mat2x2f", BuiltinType::kMat2X2F},
{"mat2x2h", BuiltinType::kMat2X2H},
{"mat2x3", BuiltinType::kMat2X3},
{"mat2x3f", BuiltinType::kMat2X3F},
{"mat2x3h", BuiltinType::kMat2X3H},
{"mat2x4", BuiltinType::kMat2X4},
{"mat2x4f", BuiltinType::kMat2X4F},
{"mat2x4h", BuiltinType::kMat2X4H},
{"mat3x2", BuiltinType::kMat3X2},
{"mat3x2f", BuiltinType::kMat3X2F},
{"mat3x2h", BuiltinType::kMat3X2H},
{"mat3x3", BuiltinType::kMat3X3},
{"mat3x3f", BuiltinType::kMat3X3F},
{"mat3x3h", BuiltinType::kMat3X3H},
{"mat3x4", BuiltinType::kMat3X4},
{"mat3x4f", BuiltinType::kMat3X4F},
{"mat3x4h", BuiltinType::kMat3X4H},
{"mat4x2", BuiltinType::kMat4X2},
{"mat4x2f", BuiltinType::kMat4X2F},
{"mat4x2h", BuiltinType::kMat4X2H},
{"mat4x3", BuiltinType::kMat4X3},
{"mat4x3f", BuiltinType::kMat4X3F},
{"mat4x3h", BuiltinType::kMat4X3H},
{"mat4x4", BuiltinType::kMat4X4},
{"mat4x4f", BuiltinType::kMat4X4F},
{"mat4x4h", BuiltinType::kMat4X4H},
{"ptr", BuiltinType::kPtr},
{"sampler", BuiltinType::kSampler},
{"sampler_comparison", BuiltinType::kSamplerComparison},
{"subgroup_matrix_left", BuiltinType::kSubgroupMatrixLeft},
{"subgroup_matrix_result", BuiltinType::kSubgroupMatrixResult},
{"subgroup_matrix_right", BuiltinType::kSubgroupMatrixRight},
{"texel_buffer", BuiltinType::kTexelBuffer},
{"texture_1d", BuiltinType::kTexture1D},
{"texture_2d", BuiltinType::kTexture2D},
{"texture_2d_array", BuiltinType::kTexture2DArray},
{"texture_3d", BuiltinType::kTexture3D},
{"texture_cube", BuiltinType::kTextureCube},
{"texture_cube_array", BuiltinType::kTextureCubeArray},
{"texture_depth_2d", BuiltinType::kTextureDepth2D},
{"texture_depth_2d_array", BuiltinType::kTextureDepth2DArray},
{"texture_depth_cube", BuiltinType::kTextureDepthCube},
{"texture_depth_cube_array", BuiltinType::kTextureDepthCubeArray},
{"texture_depth_multisampled_2d", BuiltinType::kTextureDepthMultisampled2D},
{"texture_external", BuiltinType::kTextureExternal},
{"texture_multisampled_2d", BuiltinType::kTextureMultisampled2D},
{"texture_storage_1d", BuiltinType::kTextureStorage1D},
{"texture_storage_2d", BuiltinType::kTextureStorage2D},
{"texture_storage_2d_array", BuiltinType::kTextureStorage2DArray},
{"texture_storage_3d", BuiltinType::kTextureStorage3D},
{"u16", BuiltinType::kU16},
{"u32", BuiltinType::kU32},
{"u8", BuiltinType::kU8},
{"vec2", BuiltinType::kVec2},
{"vec2f", BuiltinType::kVec2F},
{"vec2h", BuiltinType::kVec2H},
{"vec2i", BuiltinType::kVec2I},
{"vec2u", BuiltinType::kVec2U},
{"vec3", BuiltinType::kVec3},
{"vec3f", BuiltinType::kVec3F},
{"vec3h", BuiltinType::kVec3H},
{"vec3i", BuiltinType::kVec3I},
{"vec3u", BuiltinType::kVec3U},
{"vec4", BuiltinType::kVec4},
{"vec4f", BuiltinType::kVec4F},
{"vec4h", BuiltinType::kVec4H},
{"vec4i", BuiltinType::kVec4I},
{"vec4u", BuiltinType::kVec4U},
};
static constexpr BuiltinTypeCase kInvalidBuiltinTypeCases[] = {
{"__atomic_cFFmpare_exchange_result_i52", BuiltinType::kUndefined},
{"__at4zmic_compare_exchange_resurrt_i32", BuiltinType::kUndefined},
{"__atWWic_ompare_exhange_result_i32", BuiltinType::kUndefined},
{"__atomic_comZZare_JXxchange_result_C32", BuiltinType::kUndefined},
{"PP_atomic_compare_exchange_reslt_u32", BuiltinType::kUndefined},
{"__atomic_compare_exchange_resuct_u32", BuiltinType::kUndefined},
{"__frexPP_resul6_abstrllct", BuiltinType::kUndefined},
{"_frexp_result_yybstr99ct", BuiltinType::kUndefined},
{"__frexpJresult_absKKract", BuiltinType::kUndefined},
{"__frexp__xsult_f6", BuiltinType::kUndefined},
{"yfKex_result_f16", BuiltinType::kUndefined},
{"__frexpVresukt_f1z", BuiltinType::kUndefined},
{"__fKexp_Sesuqt_f32", BuiltinType::kUndefined},
{"__frexp_result_f2", BuiltinType::kUndefined},
{"__rexp_result_fVV2", BuiltinType::kUndefined},
{"__frexpAAreIult_veU2_abstract", BuiltinType::kUndefined},
{"__jrexp_rRult_vec2_abtract", BuiltinType::kUndefined},
{"_frexpres44l_vec2_abstrYYct", BuiltinType::kUndefined},
{"__frexp_result_ve2_f16", BuiltinType::kUndefined},
{"__frexxp_rsult_ve11_f19", BuiltinType::kUndefined},
{"__frexcc_msult_vec2_f1J", BuiltinType::kUndefined},
{"__frexp_reult_vec2_f3JJ", BuiltinType::kUndefined},
{"__fCCUxp_result_fecDD_f32", BuiltinType::kUndefined},
{"__frgxp_result_vec2_f32", BuiltinType::kUndefined},
{"__frep_result_vecCC_absact", BuiltinType::kUndefined},
{"__frexp_resul_vec3_abstract", BuiltinType::kUndefined},
{"__fIexp_result_vec3_abstr__ct", BuiltinType::kUndefined},
{"__rep_resultt_vecN_fPP6", BuiltinType::kUndefined},
{"_3frexp_result_vedd3_f16", BuiltinType::kUndefined},
{"__frKxp_reult_yyec3_f16", BuiltinType::kUndefined},
{"__frep_rest_vuuc3_f3", BuiltinType::kUndefined},
{"nn_fre0i_result_vec3_f33", BuiltinType::kUndefined},
{"K_frexp_renvlt_vec3uufCC2", BuiltinType::kUndefined},
{"__frllxp_Xesult_ec4_abstract", BuiltinType::kUndefined},
{"__frexp_result_vec4_aostrppct", BuiltinType::kUndefined},
{"ww_frexp_result_vec4_abstrat", BuiltinType::kUndefined},
{"uu_fgxp_reslt_vec4mmf16", BuiltinType::kUndefined},
{"aa_frexpesmmltvec4_f16", BuiltinType::kUndefined},
{"__TrexRR_result_vecZ_cc16", BuiltinType::kUndefined},
{"__frexp_result_vec8T_fO2", BuiltinType::kUndefined},
{"__frexp_mesult00vec4_f32", BuiltinType::kUndefined},
{"m_frexp_result_vBBc4_f32", BuiltinType::kUndefined},
{"__mppdfresult_Mstract", BuiltinType::kUndefined},
{"__modf_result_OObstact", BuiltinType::kUndefined},
{"__modf_resGlGG_abstrat", BuiltinType::kUndefined},
{"11_modf_reHHult_f16", BuiltinType::kUndefined},
{"__FFodfresu6ee_f16", BuiltinType::kUndefined},
{"__of_result_f16", BuiltinType::kUndefined},
{"__miilf_resultKf32", BuiltinType::kUndefined},
{"__mof_result_f32", BuiltinType::kUndefined},
{"__modII_99esult_vv3", BuiltinType::kUndefined},
{"__odf_result_vec2_abstract", BuiltinType::kUndefined},
{"__modf_result_vec2habstract", BuiltinType::kUndefined},
{"__modf_resulzllP_vec2_absract", BuiltinType::kUndefined},
{"__mod_eslt_vec2f16", BuiltinType::kUndefined},
{"__modf_ffesult_qqec2f16", BuiltinType::kUndefined},
{"W_mdf_resuldd_veJJ2_f16", BuiltinType::kUndefined},
{"__mXXdf_result_vzz_f3r", BuiltinType::kUndefined},
{"__modf_result_2ec2_32", BuiltinType::kUndefined},
{"__modf_rNsult_veyy2_f32", BuiltinType::kUndefined},
{"__modf_rOOslt_vec3_astrct", BuiltinType::kUndefined},
{"__modf_reruuZ_vec3_abEtracP", BuiltinType::kUndefined},
{"__modf_elueet_vec3_abstrac2dd", BuiltinType::kUndefined},
{"__modf_eslt_VVec9_f16", BuiltinType::kUndefined},
{"__modf_rI1sult_vec_f16", BuiltinType::kUndefined},
{"__modf_result_bec3_f16", BuiltinType::kUndefined},
{"i_mf_result_vec3z732", BuiltinType::kUndefined},
{"ii_modf_result_oec3_f32", BuiltinType::kUndefined},
{"__mdf_resul_v5c3nf32", BuiltinType::kUndefined},
{"__modf_resuliSvec4abstract", BuiltinType::kUndefined},
{"_modf_result_vec4_22btract", BuiltinType::kUndefined},
{"_117odf_Cesult_vec_abstraGt", BuiltinType::kUndefined},
{"__modf_result_vffc48f16", BuiltinType::kUndefined},
{"__mdf_rsult_vec4_f16", BuiltinType::kUndefined},
{"_JJSSodf_result_vec4_f16", BuiltinType::kUndefined},
{"__odf_re9ul_vec4_f32", BuiltinType::kUndefined},
{"__modf_bbesJJlt_vec4_fTT2", BuiltinType::kUndefined},
{"__mdf66reult_vec4_f32", BuiltinType::kUndefined},
{"u66ay", BuiltinType::kUndefined},
{"aWay", BuiltinType::kUndefined},
{"aay", BuiltinType::kUndefined},
{"atmic", BuiltinType::kUndefined},
{"rtomic", BuiltinType::kUndefined},
{"a2omiB", BuiltinType::kUndefined},
{"bindng_arrBBy", BuiltinType::kUndefined},
{"RRnding_array", BuiltinType::kUndefined},
{"VVnding_a0LLy", BuiltinType::kUndefined},
{"KOol", BuiltinType::kUndefined},
{"gwol", BuiltinType::kUndefined},
{"hpLo", BuiltinType::kUndefined},
{"iifEer", BuiltinType::kUndefined},
{"uffer", BuiltinType::kUndefined},
{"b88Uer", BuiltinType::kUndefined},
{"rrvv6", BuiltinType::kUndefined},
{"wm", BuiltinType::kUndefined},
{"fj4", BuiltinType::kUndefined},
{"X32", BuiltinType::kUndefined},
{"f82", BuiltinType::kUndefined},
{"fvEE", BuiltinType::kUndefined},
{"izi", BuiltinType::kUndefined},
{"iJJGAQ", BuiltinType::kUndefined},
{"iss2", BuiltinType::kUndefined},
{"PK", BuiltinType::kUndefined},
{"tt", BuiltinType::kUndefined},
{"", BuiltinType::kUndefined},
{"input_attachmeMMt", BuiltinType::kUndefined},
{"input_attJJch0ent", BuiltinType::kUndefined},
{"nput_tta8Vent", BuiltinType::kUndefined},
{"hggat2x2", BuiltinType::kUndefined},
{"maf2x2", BuiltinType::kUndefined},
{"maQ77x2", BuiltinType::kUndefined},
{"mat2YYf", BuiltinType::kUndefined},
{"mak2x2", BuiltinType::kUndefined},
{"man2x2", BuiltinType::kUndefined},
{"ma2FFh", BuiltinType::kUndefined},
{"uGGtIUPP2h", BuiltinType::kUndefined},
{"EEvFx2h", BuiltinType::kUndefined},
{"mBet2dd3", BuiltinType::kUndefined},
{"55atExcc", BuiltinType::kUndefined},
{"txKK", BuiltinType::kUndefined},
{"mat2x3R", BuiltinType::kUndefined},
{"maDx39", BuiltinType::kUndefined},
{"mt2x3f", BuiltinType::kUndefined},
{"aaat2I", BuiltinType::kUndefined},
{"m77t2x3h", BuiltinType::kUndefined},
{"matIx3h", BuiltinType::kUndefined},
{"matd4", BuiltinType::kUndefined},
{"mt2x4", BuiltinType::kUndefined},
{"mtt2", BuiltinType::kUndefined},
{"ma3XX2x4f", BuiltinType::kUndefined},
{"Eat24f", BuiltinType::kUndefined},
{"maXX2x4", BuiltinType::kUndefined},
{"matxBx4h", BuiltinType::kUndefined},
{"m2x4h", BuiltinType::kUndefined},
{"mat2x466", BuiltinType::kUndefined},
{"atTv0", BuiltinType::kUndefined},
{"kt", BuiltinType::kUndefined},
{"mpt3x", BuiltinType::kUndefined},
{"at112f", BuiltinType::kUndefined},
{"EaJ3yBBf", BuiltinType::kUndefined},
{"mqIm3x2f", BuiltinType::kUndefined},
{"ma3xFh", BuiltinType::kUndefined},
{"Yt3x2h", BuiltinType::kUndefined},
{"mHHtDh2h", BuiltinType::kUndefined},
{"23H3", BuiltinType::kUndefined},
{"m3x3", BuiltinType::kUndefined},
{"mat33", BuiltinType::kUndefined},
{"matx3f", BuiltinType::kUndefined},
{"matddx3f", BuiltinType::kUndefined},
{"Oat3x3f", BuiltinType::kUndefined},
{"atBbb3", BuiltinType::kUndefined},
{"m003x3h", BuiltinType::kUndefined},
{"mat3xhh", BuiltinType::kUndefined},
{"matgYx", BuiltinType::kUndefined},
{"Oat3x4", BuiltinType::kUndefined},
{"mhx4", BuiltinType::kUndefined},
{"fpaEEx4f", BuiltinType::kUndefined},
{"mavx4f", BuiltinType::kUndefined},
{"mzztx4f", BuiltinType::kUndefined},
{"ma3x4h", BuiltinType::kUndefined},
{"OOaJxii", BuiltinType::kUndefined},
{"mft3G4h", BuiltinType::kUndefined},
{"mTT224x2", BuiltinType::kUndefined},
{"lat4x2", BuiltinType::kUndefined},
{"mab4x2", BuiltinType::kUndefined},
{"BBatx2f", BuiltinType::kUndefined},
{"PPIXt4S2f", BuiltinType::kUndefined},
{"mjjt4x2f", BuiltinType::kUndefined},
{"_at4xcch", BuiltinType::kUndefined},
{"ax6z4xSSh", BuiltinType::kUndefined},
{"a4xG", BuiltinType::kUndefined},
{"mxxtvN", BuiltinType::kUndefined},
{"AA00t43", BuiltinType::kUndefined},
{"tyexy", BuiltinType::kUndefined},
{"mabWWx0f", BuiltinType::kUndefined},
{"ttatMMxmf", BuiltinType::kUndefined},
{"madf", BuiltinType::kUndefined},
{"mat_3h", BuiltinType::kUndefined},
{"Vat4EE3h", BuiltinType::kUndefined},
{"mat44h", BuiltinType::kUndefined},
{"aRtx4", BuiltinType::kUndefined},
{"Sammx", BuiltinType::kUndefined},
{"apjx4", BuiltinType::kUndefined},
{"mat4xf", BuiltinType::kUndefined},
{"aaxf", BuiltinType::kUndefined},
{"mad4x4f", BuiltinType::kUndefined},
{"CCat4xPth", BuiltinType::kUndefined},
{"matx4", BuiltinType::kUndefined},
{"m5t4x4h", BuiltinType::kUndefined},
{"ff99j", BuiltinType::kUndefined},
{"YYvXR", BuiltinType::kUndefined},
{"r", BuiltinType::kUndefined},
{"XX8m5le", BuiltinType::kUndefined},
{"mpler", BuiltinType::kUndefined},
{"sccmlppr", BuiltinType::kUndefined},
{"sampler_comparivon", BuiltinType::kUndefined},
{"sampSSerJcomparEEon", BuiltinType::kUndefined},
{"sampler_compaisn", BuiltinType::kUndefined},
{"subgou_mat_x_left", BuiltinType::kUndefined},
{"subgroup_mat_iw_left", BuiltinType::kUndefined},
{"subddroup_matrix99left", BuiltinType::kUndefined},
{"subgroup_mtrix_99eulPP", BuiltinType::kUndefined},
{"suKKgroup_mtrix_result", BuiltinType::kUndefined},
{"ubgroupDDmatriM_reooult", BuiltinType::kUndefined},
{"subropBmatriixright", BuiltinType::kUndefined},
{"sqgroup_atrix_right", BuiltinType::kUndefined},
{"subroup_mtrix_00LLght", BuiltinType::kUndefined},
{"tnxel_bvvffe66", BuiltinType::kUndefined},
{"nrxel_buffer", BuiltinType::kUndefined},
{"teeleeufxxer", BuiltinType::kUndefined},
{"CCNOxture_1d", BuiltinType::kUndefined},
{"txture_1d", BuiltinType::kUndefined},
{"tex4uae_1d", BuiltinType::kUndefined},
{"extuNNe_2NN", BuiltinType::kUndefined},
{"texture2d", BuiltinType::kUndefined},
{"tuxtre2d", BuiltinType::kUndefined},
{"teYYtuAe_2d_arESy", BuiltinType::kUndefined},
{"texture_2d_0rray", BuiltinType::kUndefined},
{"texture_2d_aarray", BuiltinType::kUndefined},
{"tqqmmtur_d", BuiltinType::kUndefined},
{"textue_3d", BuiltinType::kUndefined},
{"tUUxtureE", BuiltinType::kUndefined},
{"textuK_DDube", BuiltinType::kUndefined},
{"__ext0rt_cube", BuiltinType::kUndefined},
{"texAle_cbe", BuiltinType::kUndefined},
{"texture_cube_arMa", BuiltinType::kUndefined},
{"texture_BBube_array", BuiltinType::kUndefined},
{"textur99cbbb_arnnay", BuiltinType::kUndefined},
{"texturEEdeptAA_2d", BuiltinType::kUndefined},
{"texture5depth66Td", BuiltinType::kUndefined},
{"texture_depthH2d", BuiltinType::kUndefined},
{"textureHHdepthxxd_aray", BuiltinType::kUndefined},
{"textyy0e_depthznd_array", BuiltinType::kUndefined},
{"texture_depth_2d_arry", BuiltinType::kUndefined},
{"texurH_kepth_cube", BuiltinType::kUndefined},
{"exture_cepth_cube", BuiltinType::kUndefined},
{"ooexrrre_dpth_cube", BuiltinType::kUndefined},
{"textre_depthJJube_array", BuiltinType::kUndefined},
{"tCCxture_dep0h_ube_array", BuiltinType::kUndefined},
{"99eFure_depth_cube_AArxay", BuiltinType::kUndefined},
{"texture_cepth_multisampled_2d", BuiltinType::kUndefined},
{"texture_deSth_multisampled_2d", BuiltinType::kUndefined},
{"texture_deph_muotisaspled_2BB", BuiltinType::kUndefined},
{"texture_extenal", BuiltinType::kUndefined},
{"textummeexternal", BuiltinType::kUndefined},
{"toxture_ggxQQePPal", BuiltinType::kUndefined},
{"teture_mltisamBed_2", BuiltinType::kUndefined},
{"texture_mlllNKismpled2d", BuiltinType::kUndefined},
{"eturrr_multisampled_2d", BuiltinType::kUndefined},
{"texrure_tpprage_1d", BuiltinType::kUndefined},
{"teyture_storage_PPd", BuiltinType::kUndefined},
{"teture_stoZZcge_1d", BuiltinType::kUndefined},
{"txtue_storage_2d", BuiltinType::kUndefined},
{"texture00storage_2d", BuiltinType::kUndefined},
{"texPPuBB_stJrage_ssd", BuiltinType::kUndefined},
{"textureffsforage_2dwwaJJay", BuiltinType::kUndefined},
{"XXexture_stoage_2I_array", BuiltinType::kUndefined},
{"textre_stoage2_arry", BuiltinType::kUndefined},
{"textue_storage_3d", BuiltinType::kUndefined},
{"tuxtreKKstorage_3d", BuiltinType::kUndefined},
{"44edture_stomag_3d", BuiltinType::kUndefined},
{"po6", BuiltinType::kUndefined},
{"HhNj6", BuiltinType::kUndefined},
{"E1ww3U", BuiltinType::kUndefined},
{"uu", BuiltinType::kUndefined},
{"rrdd", BuiltinType::kUndefined},
{"ttPP", BuiltinType::kUndefined},
{"sww", BuiltinType::kUndefined},
{"nn11", BuiltinType::kUndefined},
{"u", BuiltinType::kUndefined},
{"ve2", BuiltinType::kUndefined},
{"IeSSa6", BuiltinType::kUndefined},
{"EEc2", BuiltinType::kUndefined},
{"veIccR", BuiltinType::kUndefined},
{"ec9", BuiltinType::kUndefined},
{"aec2f", BuiltinType::kUndefined},
{"LSc2h", BuiltinType::kUndefined},
{"ecmm", BuiltinType::kUndefined},
{"4ecV", BuiltinType::kUndefined},
{"vc__", BuiltinType::kUndefined},
{"vQ2", BuiltinType::kUndefined},
{"veERdd", BuiltinType::kUndefined},
{"vec9", BuiltinType::kUndefined},
{"e02", BuiltinType::kUndefined},
{"vzu", BuiltinType::kUndefined},
{"veccc", BuiltinType::kUndefined},
{"_cQQ", BuiltinType::kUndefined},
{"tc3", BuiltinType::kUndefined},
{"zz3ecECpp", BuiltinType::kUndefined},
{"veddhhf", BuiltinType::kUndefined},
{"e7766f", BuiltinType::kUndefined},
{"vec3P", BuiltinType::kUndefined},
{"vecwh", BuiltinType::kUndefined},
{"ecu", BuiltinType::kUndefined},
{"vXXc3i", BuiltinType::kUndefined},
{"Rc3", BuiltinType::kUndefined},
{"e1V", BuiltinType::kUndefined},
{"vecHHGG", BuiltinType::kUndefined},
{"MeFF3u", BuiltinType::kUndefined},
{"ve3u", BuiltinType::kUndefined},
{"ggc", BuiltinType::kUndefined},
{"1eKK4", BuiltinType::kUndefined},
{"veE", BuiltinType::kUndefined},
{"c4M", BuiltinType::kUndefined},
{"veS77G4", BuiltinType::kUndefined},
{"vKFttf", BuiltinType::kUndefined},
{"vZZUss4h", BuiltinType::kUndefined},
{"vc4h", BuiltinType::kUndefined},
{"lec4h", BuiltinType::kUndefined},
{"veh4i", BuiltinType::kUndefined},
{"vkcTT", BuiltinType::kUndefined},
{"vewwi", BuiltinType::kUndefined},
{"vejjKv", BuiltinType::kUndefined},
{"Ye4u", BuiltinType::kUndefined},
{"EeIIu", BuiltinType::kUndefined},
};
using BuiltinTypeParseTest = testing::TestWithParam<BuiltinTypeCase>;
TEST_P(BuiltinTypeParseTest, Parse) {
const char* string = GetParam().string;
BuiltinType expect = GetParam().value;
EXPECT_EQ(expect, ParseBuiltinType(string));
}
INSTANTIATE_TEST_SUITE_P(ValidBuiltinTypeCases, BuiltinTypeParseTest, testing::ValuesIn(kValidBuiltinTypeCases));
INSTANTIATE_TEST_SUITE_P(InvalidBuiltinTypeCases, BuiltinTypeParseTest, testing::ValuesIn(kInvalidBuiltinTypeCases));
using BuiltinTypePrintTest = testing::TestWithParam<BuiltinTypeCase>;
TEST_P(BuiltinTypePrintTest, Print) {
BuiltinType value = GetParam().value;
const char* expect = GetParam().string;
EXPECT_EQ(expect, ToString(value));
}
INSTANTIATE_TEST_SUITE_P(ValidBuiltinTypeCases, BuiltinTypePrintTest, testing::ValuesIn(kValidBuiltinTypeCases));
} // namespace parse_print_tests
namespace parse_print_tests {
struct BuiltinValueCase {
const char* string;
BuiltinValue value;
};
inline std::ostream& operator<<(std::ostream& out, BuiltinValueCase c) {
return out << "'" << std::string(c.string) << "'";
}
static constexpr BuiltinValueCase kValidBuiltinValueCases[] = {
{"barycentric_coord", BuiltinValue::kBarycentricCoord},
{"clip_distances", BuiltinValue::kClipDistances},
{"frag_depth", BuiltinValue::kFragDepth},
{"front_facing", BuiltinValue::kFrontFacing},
{"global_invocation_id", BuiltinValue::kGlobalInvocationId},
{"global_invocation_index", BuiltinValue::kGlobalInvocationIndex},
{"instance_index", BuiltinValue::kInstanceIndex},
{"local_invocation_id", BuiltinValue::kLocalInvocationId},
{"local_invocation_index", BuiltinValue::kLocalInvocationIndex},
{"num_subgroups", BuiltinValue::kNumSubgroups},
{"num_workgroups", BuiltinValue::kNumWorkgroups},
{"position", BuiltinValue::kPosition},
{"primitive_index", BuiltinValue::kPrimitiveIndex},
{"sample_index", BuiltinValue::kSampleIndex},
{"sample_mask", BuiltinValue::kSampleMask},
{"subgroup_id", BuiltinValue::kSubgroupId},
{"subgroup_invocation_id", BuiltinValue::kSubgroupInvocationId},
{"subgroup_size", BuiltinValue::kSubgroupSize},
{"vertex_index", BuiltinValue::kVertexIndex},
{"workgroup_id", BuiltinValue::kWorkgroupId},
{"workgroup_index", BuiltinValue::kWorkgroupIndex},
};
static constexpr BuiltinValueCase kInvalidBuiltinValueCases[] = {
{"bQQrycentric_coord", BuiltinValue::kUndefined},
{"brycenticlcoorP", BuiltinValue::kUndefined},
{"barycentHHffccoord", BuiltinValue::kUndefined},
{"clip_distnnces", BuiltinValue::kUndefined},
{"cligd6Fstances", BuiltinValue::kUndefined},
{"clss8_dishances", BuiltinValue::kUndefined},
{"fra_deFFllh", BuiltinValue::kUndefined},
{"fra_dept20", BuiltinValue::kUndefined},
{"grag_depth", BuiltinValue::kUndefined},
{"frone_facng", BuiltinValue::kUndefined},
{"front_fffing", BuiltinValue::kUndefined},
{"ron_facng", BuiltinValue::kUndefined},
{"global_nvocation_id", BuiltinValue::kUndefined},
{"global_invocatioqq_i", BuiltinValue::kUndefined},
{"glAAalnvocation_id", BuiltinValue::kUndefined},
{"global_vnvocation_inex", BuiltinValue::kUndefined},
{"global_invocjjtion_indx", BuiltinValue::kUndefined},
{"global_invocatZZon_index", BuiltinValue::kUndefined},
{"iOPstanc2_IIUdex", BuiltinValue::kUndefined},
{"instanceZZindex", BuiltinValue::kUndefined},
{"instance_indenn", BuiltinValue::kUndefined},
{"ZZocal_i2kkvocatioH_id", BuiltinValue::kUndefined},
{"local_invocaion_id", BuiltinValue::kUndefined},
{"locaRinvocation_d", BuiltinValue::kUndefined},
{"lqqcal_inv99cation_index", BuiltinValue::kUndefined},
{"local_inv77cation_index", BuiltinValue::kUndefined},
{"local_invocati3_inex", BuiltinValue::kUndefined},
{"num_uubgrccups", BuiltinValue::kUndefined},
{"n1m_subroRRps", BuiltinValue::kUndefined},
{"null_subJJoups", BuiltinValue::kUndefined},
{"nuI_woMMkros", BuiltinValue::kUndefined},
{"6Tum_wo7groxps", BuiltinValue::kUndefined},
{"num_woJkgrouQQs", BuiltinValue::kUndefined},
{"pAtiuun", BuiltinValue::kUndefined},
{"posion", BuiltinValue::kUndefined},
{"q33sytn", BuiltinValue::kUndefined},
{"primxxtive_index", BuiltinValue::kUndefined},
{"Nrimrive_idex", BuiltinValue::kUndefined},
{"rimitive_i99dex", BuiltinValue::kUndefined},
{"sample_idex", BuiltinValue::kUndefined},
{"sample_KnHl", BuiltinValue::kUndefined},
{"_ame_index", BuiltinValue::kUndefined},
{"sampe_mask", BuiltinValue::kUndefined},
{"sajple_mak", BuiltinValue::kUndefined},
{"sampleEEtmmask", BuiltinValue::kUndefined},
{"subgrp_id", BuiltinValue::kUndefined},
{"urrgroup_id", BuiltinValue::kUndefined},
{"sxbgroupid", BuiltinValue::kUndefined},
{"subgroup_izzoction_id", BuiltinValue::kUndefined},
{"subgroupeinvocation_id", BuiltinValue::kUndefined},
{"subgruppp_inoZation_id", BuiltinValue::kUndefined},
{"sTTbg00ou_7izuu", BuiltinValue::kUndefined},
{"JJgrouvvsize", BuiltinValue::kUndefined},
{"subgrouQ_size", BuiltinValue::kUndefined},
{"vRrtex_Cne3", BuiltinValue::kUndefined},
{"verexCne", BuiltinValue::kUndefined},
{"vertrrxPPipde", BuiltinValue::kUndefined},
{"88orkuuxxDDu_id", BuiltinValue::kUndefined},
{"woqqkYYrlldum_id", BuiltinValue::kUndefined},
{"workgru__FFid", BuiltinValue::kUndefined},
{"rrGoNNkgroup_inde", BuiltinValue::kUndefined},
{"workgroup_lnMex", BuiltinValue::kUndefined},
{"orkgropindex", BuiltinValue::kUndefined},
};
using BuiltinValueParseTest = testing::TestWithParam<BuiltinValueCase>;
TEST_P(BuiltinValueParseTest, Parse) {
const char* string = GetParam().string;
BuiltinValue expect = GetParam().value;
EXPECT_EQ(expect, ParseBuiltinValue(string));
}
INSTANTIATE_TEST_SUITE_P(ValidBuiltinValueCases, BuiltinValueParseTest, testing::ValuesIn(kValidBuiltinValueCases));
INSTANTIATE_TEST_SUITE_P(InvalidBuiltinValueCases, BuiltinValueParseTest, testing::ValuesIn(kInvalidBuiltinValueCases));
using BuiltinValuePrintTest = testing::TestWithParam<BuiltinValueCase>;
TEST_P(BuiltinValuePrintTest, Print) {
BuiltinValue value = GetParam().value;
const char* expect = GetParam().string;
EXPECT_EQ(expect, ToString(value));
}
INSTANTIATE_TEST_SUITE_P(ValidBuiltinValueCases, BuiltinValuePrintTest, testing::ValuesIn(kValidBuiltinValueCases));
} // namespace parse_print_tests
namespace parse_print_tests {
struct AttributeCase {
const char* string;
Attribute value;
};
inline std::ostream& operator<<(std::ostream& out, AttributeCase c) {
return out << "'" << std::string(c.string) << "'";
}
static constexpr AttributeCase kValidAttributeCases[] = {
{"align", Attribute::kAlign},
{"binding", Attribute::kBinding},
{"blend_src", Attribute::kBlendSrc},
{"builtin", Attribute::kBuiltin},
{"color", Attribute::kColor},
{"compute", Attribute::kCompute},
{"diagnostic", Attribute::kDiagnostic},
{"fragment", Attribute::kFragment},
{"group", Attribute::kGroup},
{"id", Attribute::kId},
{"input_attachment_index", Attribute::kInputAttachmentIndex},
{"interpolate", Attribute::kInterpolate},
{"invariant", Attribute::kInvariant},
{"location", Attribute::kLocation},
{"must_use", Attribute::kMustUse},
{"size", Attribute::kSize},
{"subgroup_size", Attribute::kSubgroupSize},
{"vertex", Attribute::kVertex},
{"workgroup_size", Attribute::kWorkgroupSize},
};
static constexpr AttributeCase kInvalidAttributeCases[] = {
{"xlign", Attribute::kUndefined},
{"lign", Attribute::kUndefined},
{"al44n", Attribute::kUndefined},
{"WWGnding", Attribute::kUndefined},
{"bjjndig", Attribute::kUndefined},
{"bijjding", Attribute::kUndefined},
{"blenj_sc", Attribute::kUndefined},
{"blnd_src", Attribute::kUndefined},
{"blend_s99c", Attribute::kUndefined},
{"buiVVtyn", Attribute::kUndefined},
{"builZix", Attribute::kUndefined},
{"b33ilvvi", Attribute::kUndefined},
{"cols9", Attribute::kUndefined},
{"coFo", Attribute::kUndefined},
{"uelor", Attribute::kUndefined},
{"oKKIte", Attribute::kUndefined},
{"cJmput", Attribute::kUndefined},
{"XXCCmpSSte", Attribute::kUndefined},
{"dJaZZWW6ostic", Attribute::kUndefined},
{"diagno5ic", Attribute::kUndefined},
{"diBBBUnosic", Attribute::kUndefined},
{"JJ0agmen11", Attribute::kUndefined},
{"ffagttent", Attribute::kUndefined},
{"fttment", Attribute::kUndefined},
{"grLup", Attribute::kUndefined},
{"g1oup", Attribute::kUndefined},
{"grwwup", Attribute::kUndefined},
{"", Attribute::kUndefined},
{"i", Attribute::kUndefined},
{"NNd", Attribute::kUndefined},
{"inp__Ul_attachment_indeRR", Attribute::kUndefined},
{"input_attachment_inHex", Attribute::kUndefined},
{"inpur_attachment_indCCx", Attribute::kUndefined},
{"interpoate", Attribute::kUndefined},
{"dterppplate", Attribute::kUndefined},
{"interpolae", Attribute::kUndefined},
{"ivrNanL", Attribute::kUndefined},
{"inan", Attribute::kUndefined},
{"iqqxvRRianGG", Attribute::kUndefined},
{"locaGGiSn", Attribute::kUndefined},
{"occ88ion", Attribute::kUndefined},
{"locatio", Attribute::kUndefined},
{"muppt_ue", Attribute::kUndefined},
{"mu0FFtqqus55", Attribute::kUndefined},
{"mus_use", Attribute::kUndefined},
{"ie", Attribute::kUndefined},
{"Oiz", Attribute::kUndefined},
{"sTHH", Attribute::kUndefined},
{"subg66oup_SSOze", Attribute::kUndefined},
{"subgrTTu_YYizdd", Attribute::kUndefined},
{"subggrsupsize", Attribute::kUndefined},
{"verGGex", Attribute::kUndefined},
{"OQIrtell", Attribute::kUndefined},
{"vrtex", Attribute::kUndefined},
{"worrrgroup_size", Attribute::kUndefined},
{"workgru7y_size", Attribute::kUndefined},
{"workYBBoup22size", Attribute::kUndefined},
};
using AttributeParseTest = testing::TestWithParam<AttributeCase>;
TEST_P(AttributeParseTest, Parse) {
const char* string = GetParam().string;
Attribute expect = GetParam().value;
EXPECT_EQ(expect, ParseAttribute(string));
}
INSTANTIATE_TEST_SUITE_P(ValidAttributeCases, AttributeParseTest, testing::ValuesIn(kValidAttributeCases));
INSTANTIATE_TEST_SUITE_P(InvalidAttributeCases, AttributeParseTest, testing::ValuesIn(kInvalidAttributeCases));
using AttributePrintTest = testing::TestWithParam<AttributeCase>;
TEST_P(AttributePrintTest, Print) {
Attribute value = GetParam().value;
const char* expect = GetParam().string;
EXPECT_EQ(expect, ToString(value));
}
INSTANTIATE_TEST_SUITE_P(ValidAttributeCases, AttributePrintTest, testing::ValuesIn(kValidAttributeCases));
} // namespace parse_print_tests
} // namespace
} // namespace tint::core
// clang-format on