tint: Rename kInvalid to kUndefined for enums
This is a more neutral term for an unassigned enum value.
Change-Id: Ic69d912472f26fd8a2c8348281b27edfcc145eab
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/105480
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
diff --git a/src/tint/ast/access.cc b/src/tint/ast/access.cc
index 3997715..7ca9b52 100644
--- a/src/tint/ast/access.cc
+++ b/src/tint/ast/access.cc
@@ -26,7 +26,7 @@
/// ParseAccess parses a Access from a string.
/// @param str the string to parse
-/// @returns the parsed enum, or Access::kInvalid if the string could not be parsed.
+/// @returns the parsed enum, or Access::kUndefined if the string could not be parsed.
Access ParseAccess(std::string_view str) {
if (str == "read") {
return Access::kRead;
@@ -37,13 +37,13 @@
if (str == "write") {
return Access::kWrite;
}
- return Access::kInvalid;
+ return Access::kUndefined;
}
std::ostream& operator<<(std::ostream& out, Access value) {
switch (value) {
- case Access::kInvalid:
- return out << "invalid";
+ case Access::kUndefined:
+ return out << "undefined";
case Access::kRead:
return out << "read";
case Access::kReadWrite:
diff --git a/src/tint/ast/access.h b/src/tint/ast/access.h
index 12e1a20..e213691 100644
--- a/src/tint/ast/access.h
+++ b/src/tint/ast/access.h
@@ -29,7 +29,7 @@
/// Address space of a given pointer.
enum class Access {
- kInvalid,
+ kUndefined,
kRead,
kReadWrite,
kWrite,
@@ -42,7 +42,7 @@
/// ParseAccess parses a Access from a string.
/// @param str the string to parse
-/// @returns the parsed enum, or Access::kInvalid if the string could not be parsed.
+/// @returns the parsed enum, or Access::kUndefined if the string could not be parsed.
Access ParseAccess(std::string_view str);
constexpr const char* kAccessStrings[] = {
diff --git a/src/tint/ast/address_space.cc b/src/tint/ast/address_space.cc
index d8174a2..260f86b 100644
--- a/src/tint/ast/address_space.cc
+++ b/src/tint/ast/address_space.cc
@@ -26,7 +26,7 @@
/// ParseAddressSpace parses a AddressSpace from a string.
/// @param str the string to parse
-/// @returns the parsed enum, or AddressSpace::kInvalid if the string could not be parsed.
+/// @returns the parsed enum, or AddressSpace::kUndefined if the string could not be parsed.
AddressSpace ParseAddressSpace(std::string_view str) {
if (str == "function") {
return AddressSpace::kFunction;
@@ -46,13 +46,13 @@
if (str == "workgroup") {
return AddressSpace::kWorkgroup;
}
- return AddressSpace::kInvalid;
+ return AddressSpace::kUndefined;
}
std::ostream& operator<<(std::ostream& out, AddressSpace value) {
switch (value) {
- case AddressSpace::kInvalid:
- return out << "invalid";
+ case AddressSpace::kUndefined:
+ return out << "undefined";
case AddressSpace::kFunction:
return out << "function";
case AddressSpace::kHandle:
diff --git a/src/tint/ast/address_space.h b/src/tint/ast/address_space.h
index 8b96f0f..d599975 100644
--- a/src/tint/ast/address_space.h
+++ b/src/tint/ast/address_space.h
@@ -29,7 +29,7 @@
/// Address space of a given pointer.
enum class AddressSpace {
- kInvalid,
+ kUndefined,
kFunction,
kHandle, // Tint-internal enum entry - not parsed
kIn, // Tint-internal enum entry - not parsed
@@ -49,7 +49,7 @@
/// ParseAddressSpace parses a AddressSpace from a string.
/// @param str the string to parse
-/// @returns the parsed enum, or AddressSpace::kInvalid if the string could not be parsed.
+/// @returns the parsed enum, or AddressSpace::kUndefined if the string could not be parsed.
AddressSpace ParseAddressSpace(std::string_view str);
constexpr const char* kAddressSpaceStrings[] = {
diff --git a/src/tint/ast/address_space_test.cc b/src/tint/ast/address_space_test.cc
index 271cf33..83646be 100644
--- a/src/tint/ast/address_space_test.cc
+++ b/src/tint/ast/address_space_test.cc
@@ -51,15 +51,15 @@
};
static constexpr Case kInvalidCases[] = {
- {"fccnctin", AddressSpace::kInvalid}, {"ucti3", AddressSpace::kInvalid},
- {"functVon", AddressSpace::kInvalid}, {"priv1te", AddressSpace::kInvalid},
- {"pqiJate", AddressSpace::kInvalid}, {"privat7ll", AddressSpace::kInvalid},
- {"pqqsh_pponstHnt", AddressSpace::kInvalid}, {"pus_cnstat", AddressSpace::kInvalid},
- {"bus_Gonstant", AddressSpace::kInvalid}, {"storiive", AddressSpace::kInvalid},
- {"8WWorage", AddressSpace::kInvalid}, {"sxxrage", AddressSpace::kInvalid},
- {"uXforgg", AddressSpace::kInvalid}, {"nfoXm", AddressSpace::kInvalid},
- {"unif3rm", AddressSpace::kInvalid}, {"workgroEp", AddressSpace::kInvalid},
- {"woTTPkroup", AddressSpace::kInvalid}, {"ddorkroxxp", AddressSpace::kInvalid},
+ {"fccnctin", AddressSpace::kUndefined}, {"ucti3", AddressSpace::kUndefined},
+ {"functVon", AddressSpace::kUndefined}, {"priv1te", AddressSpace::kUndefined},
+ {"pqiJate", AddressSpace::kUndefined}, {"privat7ll", AddressSpace::kUndefined},
+ {"pqqsh_pponstHnt", AddressSpace::kUndefined}, {"pus_cnstat", AddressSpace::kUndefined},
+ {"bus_Gonstant", AddressSpace::kUndefined}, {"storiive", AddressSpace::kUndefined},
+ {"8WWorage", AddressSpace::kUndefined}, {"sxxrage", AddressSpace::kUndefined},
+ {"uXforgg", AddressSpace::kUndefined}, {"nfoXm", AddressSpace::kUndefined},
+ {"unif3rm", AddressSpace::kUndefined}, {"workgroEp", AddressSpace::kUndefined},
+ {"woTTPkroup", AddressSpace::kUndefined}, {"ddorkroxxp", AddressSpace::kUndefined},
};
using AddressSpaceParseTest = testing::TestWithParam<Case>;
diff --git a/src/tint/ast/builtin_texture_helper_test.h b/src/tint/ast/builtin_texture_helper_test.h
index bb61875..2c4515b 100644
--- a/src/tint/ast/builtin_texture_helper_test.h
+++ b/src/tint/ast/builtin_texture_helper_test.h
@@ -241,7 +241,7 @@
Access const access = Access::kReadWrite;
/// The image format for the storage texture
/// Used only when texture_kind is kStorage
- ast::TexelFormat const texel_format = ast::TexelFormat::kInvalid;
+ ast::TexelFormat const texel_format = ast::TexelFormat::kUndefined;
/// The dimensions of the texture parameter
ast::TextureDimension const texture_dimension;
/// The data type of the texture parameter
diff --git a/src/tint/ast/builtin_value.cc b/src/tint/ast/builtin_value.cc
index d4eaec0..0a4439b 100644
--- a/src/tint/ast/builtin_value.cc
+++ b/src/tint/ast/builtin_value.cc
@@ -26,7 +26,7 @@
/// ParseBuiltinValue parses a BuiltinValue from a string.
/// @param str the string to parse
-/// @returns the parsed enum, or BuiltinValue::kInvalid if the string could not be parsed.
+/// @returns the parsed enum, or BuiltinValue::kUndefined if the string could not be parsed.
BuiltinValue ParseBuiltinValue(std::string_view str) {
if (str == "frag_depth") {
return BuiltinValue::kFragDepth;
@@ -64,13 +64,13 @@
if (str == "workgroup_id") {
return BuiltinValue::kWorkgroupId;
}
- return BuiltinValue::kInvalid;
+ return BuiltinValue::kUndefined;
}
std::ostream& operator<<(std::ostream& out, BuiltinValue value) {
switch (value) {
- case BuiltinValue::kInvalid:
- return out << "invalid";
+ case BuiltinValue::kUndefined:
+ return out << "undefined";
case BuiltinValue::kFragDepth:
return out << "frag_depth";
case BuiltinValue::kFrontFacing:
diff --git a/src/tint/ast/builtin_value.h b/src/tint/ast/builtin_value.h
index f7dd660..3a3c786 100644
--- a/src/tint/ast/builtin_value.h
+++ b/src/tint/ast/builtin_value.h
@@ -29,7 +29,7 @@
/// Builtin value defined with `@builtin(<name>)`.
enum class BuiltinValue {
- kInvalid,
+ kUndefined,
kFragDepth,
kFrontFacing,
kGlobalInvocationId,
@@ -52,7 +52,7 @@
/// ParseBuiltinValue parses a BuiltinValue from a string.
/// @param str the string to parse
-/// @returns the parsed enum, or BuiltinValue::kInvalid if the string could not be parsed.
+/// @returns the parsed enum, or BuiltinValue::kUndefined if the string could not be parsed.
BuiltinValue ParseBuiltinValue(std::string_view str);
constexpr const char* kBuiltinValueStrings[] = {
diff --git a/src/tint/ast/builtin_value_test.cc b/src/tint/ast/builtin_value_test.cc
index 55f8e4d..0ee2206 100644
--- a/src/tint/ast/builtin_value_test.cc
+++ b/src/tint/ast/builtin_value_test.cc
@@ -57,42 +57,42 @@
};
static constexpr Case kInvalidCases[] = {
- {"fragdeccth", BuiltinValue::kInvalid},
- {"flaget3", BuiltinValue::kInvalid},
- {"fVag_depth", BuiltinValue::kInvalid},
- {"1ront_facing", BuiltinValue::kInvalid},
- {"front_fJcqng", BuiltinValue::kInvalid},
- {"frllnt_facin77", BuiltinValue::kInvalid},
- {"global_invoqqtionppHid", BuiltinValue::kInvalid},
- {"clvbal_inocaionid", BuiltinValue::kInvalid},
- {"global_Gvocation_id", BuiltinValue::kInvalid},
- {"invtance_iniiex", BuiltinValue::kInvalid},
- {"8nstanceWWindex", BuiltinValue::kInvalid},
- {"insxxanceindex", BuiltinValue::kInvalid},
- {"lXcal_invoation_igg", BuiltinValue::kInvalid},
- {"Xocal_nvocatin_Vd", BuiltinValue::kInvalid},
- {"local_invoca3ion_id", BuiltinValue::kInvalid},
- {"local_invocation_indeE", BuiltinValue::kInvalid},
- {"loTTal_invPPcatin_index", BuiltinValue::kInvalid},
- {"loal_invocadxxion_index", BuiltinValue::kInvalid},
- {"num_work44roups", BuiltinValue::kInvalid},
- {"num_wVVrkgSSoups", BuiltinValue::kInvalid},
- {"Rum_wokgrou2Rs", BuiltinValue::kInvalid},
- {"oFi9ion", BuiltinValue::kInvalid},
- {"postion", BuiltinValue::kInvalid},
- {"ROOoHiiVn", BuiltinValue::kInvalid},
- {"samply_inde", BuiltinValue::kInvalid},
- {"snrrmpl77l_indGx", BuiltinValue::kInvalid},
- {"00ample4index", BuiltinValue::kInvalid},
- {"smoo_mask", BuiltinValue::kInvalid},
- {"sampzemask", BuiltinValue::kInvalid},
- {"ppaplii1_mas", BuiltinValue::kInvalid},
- {"vertex_iXXdex", BuiltinValue::kInvalid},
- {"5nnertex_99IIdex", BuiltinValue::kInvalid},
- {"verYeaaHHrrndeSS", BuiltinValue::kInvalid},
- {"workkgHo_i", BuiltinValue::kInvalid},
- {"worRgoupjid", BuiltinValue::kInvalid},
- {"wrkgrupbid", BuiltinValue::kInvalid},
+ {"fragdeccth", BuiltinValue::kUndefined},
+ {"flaget3", BuiltinValue::kUndefined},
+ {"fVag_depth", BuiltinValue::kUndefined},
+ {"1ront_facing", BuiltinValue::kUndefined},
+ {"front_fJcqng", BuiltinValue::kUndefined},
+ {"frllnt_facin77", BuiltinValue::kUndefined},
+ {"global_invoqqtionppHid", BuiltinValue::kUndefined},
+ {"clvbal_inocaionid", BuiltinValue::kUndefined},
+ {"global_Gvocation_id", BuiltinValue::kUndefined},
+ {"invtance_iniiex", BuiltinValue::kUndefined},
+ {"8nstanceWWindex", BuiltinValue::kUndefined},
+ {"insxxanceindex", BuiltinValue::kUndefined},
+ {"lXcal_invoation_igg", BuiltinValue::kUndefined},
+ {"Xocal_nvocatin_Vd", BuiltinValue::kUndefined},
+ {"local_invoca3ion_id", BuiltinValue::kUndefined},
+ {"local_invocation_indeE", BuiltinValue::kUndefined},
+ {"loTTal_invPPcatin_index", BuiltinValue::kUndefined},
+ {"loal_invocadxxion_index", BuiltinValue::kUndefined},
+ {"num_work44roups", BuiltinValue::kUndefined},
+ {"num_wVVrkgSSoups", BuiltinValue::kUndefined},
+ {"Rum_wokgrou2Rs", BuiltinValue::kUndefined},
+ {"oFi9ion", BuiltinValue::kUndefined},
+ {"postion", BuiltinValue::kUndefined},
+ {"ROOoHiiVn", BuiltinValue::kUndefined},
+ {"samply_inde", BuiltinValue::kUndefined},
+ {"snrrmpl77l_indGx", BuiltinValue::kUndefined},
+ {"00ample4index", BuiltinValue::kUndefined},
+ {"smoo_mask", BuiltinValue::kUndefined},
+ {"sampzemask", BuiltinValue::kUndefined},
+ {"ppaplii1_mas", BuiltinValue::kUndefined},
+ {"vertex_iXXdex", BuiltinValue::kUndefined},
+ {"5nnertex_99IIdex", BuiltinValue::kUndefined},
+ {"verYeaaHHrrndeSS", BuiltinValue::kUndefined},
+ {"workkgHo_i", BuiltinValue::kUndefined},
+ {"worRgoupjid", BuiltinValue::kUndefined},
+ {"wrkgrupbid", BuiltinValue::kUndefined},
};
using BuiltinValueParseTest = testing::TestWithParam<Case>;
diff --git a/src/tint/ast/extension.cc b/src/tint/ast/extension.cc
index a4d823f..be16806 100644
--- a/src/tint/ast/extension.cc
+++ b/src/tint/ast/extension.cc
@@ -26,7 +26,7 @@
/// ParseExtension parses a Extension from a string.
/// @param str the string to parse
-/// @returns the parsed enum, or Extension::kInvalid if the string could not be parsed.
+/// @returns the parsed enum, or Extension::kUndefined if the string could not be parsed.
Extension ParseExtension(std::string_view str) {
if (str == "chromium_disable_uniformity_analysis") {
return Extension::kChromiumDisableUniformityAnalysis;
@@ -40,13 +40,13 @@
if (str == "f16") {
return Extension::kF16;
}
- return Extension::kInvalid;
+ return Extension::kUndefined;
}
std::ostream& operator<<(std::ostream& out, Extension value) {
switch (value) {
- case Extension::kInvalid:
- return out << "invalid";
+ case Extension::kUndefined:
+ return out << "undefined";
case Extension::kChromiumDisableUniformityAnalysis:
return out << "chromium_disable_uniformity_analysis";
case Extension::kChromiumExperimentalDp4A:
diff --git a/src/tint/ast/extension.h b/src/tint/ast/extension.h
index 4d1a937..f6fa03f 100644
--- a/src/tint/ast/extension.h
+++ b/src/tint/ast/extension.h
@@ -32,7 +32,7 @@
/// An enumerator of WGSL extensions
/// @see src/tint/intrinsics.def for extension descriptions
enum class Extension {
- kInvalid,
+ kUndefined,
kChromiumDisableUniformityAnalysis,
kChromiumExperimentalDp4A,
kChromiumExperimentalPushConstant,
@@ -46,7 +46,7 @@
/// ParseExtension parses a Extension from a string.
/// @param str the string to parse
-/// @returns the parsed enum, or Extension::kInvalid if the string could not be parsed.
+/// @returns the parsed enum, or Extension::kUndefined if the string could not be parsed.
Extension ParseExtension(std::string_view str);
constexpr const char* kExtensionStrings[] = {
diff --git a/src/tint/ast/extension_test.cc b/src/tint/ast/extension_test.cc
index e43266c..2879bf8 100644
--- a/src/tint/ast/extension_test.cc
+++ b/src/tint/ast/extension_test.cc
@@ -49,18 +49,18 @@
};
static constexpr Case kInvalidCases[] = {
- {"chromium_disableuniformiccy_analysis", Extension::kInvalid},
- {"chromil3_disable_unifority_analss", Extension::kInvalid},
- {"chromium_disable_Vniformity_analysis", Extension::kInvalid},
- {"chro1ium_experimental_dp4a", Extension::kInvalid},
- {"chrJmium_experiqqetal_dp4a", Extension::kInvalid},
- {"chromium_experimenll77l_dp4a", Extension::kInvalid},
- {"cppromium_experiHHenal_qqush_constant", Extension::kInvalid},
- {"chromium_xpericental_sh_vonstant", Extension::kInvalid},
- {"chromium_experimental_Gsh_cbnstant", Extension::kInvalid},
- {"f1vi", Extension::kInvalid},
- {"f8WW", Extension::kInvalid},
- {"fxx", Extension::kInvalid},
+ {"chromium_disableuniformiccy_analysis", Extension::kUndefined},
+ {"chromil3_disable_unifority_analss", Extension::kUndefined},
+ {"chromium_disable_Vniformity_analysis", Extension::kUndefined},
+ {"chro1ium_experimental_dp4a", Extension::kUndefined},
+ {"chrJmium_experiqqetal_dp4a", Extension::kUndefined},
+ {"chromium_experimenll77l_dp4a", Extension::kUndefined},
+ {"cppromium_experiHHenal_qqush_constant", Extension::kUndefined},
+ {"chromium_xpericental_sh_vonstant", Extension::kUndefined},
+ {"chromium_experimental_Gsh_cbnstant", Extension::kUndefined},
+ {"f1vi", Extension::kUndefined},
+ {"f8WW", Extension::kUndefined},
+ {"fxx", Extension::kUndefined},
};
using ExtensionParseTest = testing::TestWithParam<Case>;
diff --git a/src/tint/ast/interpolate_attribute.cc b/src/tint/ast/interpolate_attribute.cc
index 7c89ee1..2e9ef2a 100644
--- a/src/tint/ast/interpolate_attribute.cc
+++ b/src/tint/ast/interpolate_attribute.cc
@@ -51,7 +51,7 @@
/// ParseInterpolationType parses a InterpolationType from a string.
/// @param str the string to parse
-/// @returns the parsed enum, or InterpolationType::kInvalid if the string could not be parsed.
+/// @returns the parsed enum, or InterpolationType::kUndefined if the string could not be parsed.
InterpolationType ParseInterpolationType(std::string_view str) {
if (str == "flat") {
return InterpolationType::kFlat;
@@ -62,13 +62,13 @@
if (str == "perspective") {
return InterpolationType::kPerspective;
}
- return InterpolationType::kInvalid;
+ return InterpolationType::kUndefined;
}
std::ostream& operator<<(std::ostream& out, InterpolationType value) {
switch (value) {
- case InterpolationType::kInvalid:
- return out << "invalid";
+ case InterpolationType::kUndefined:
+ return out << "undefined";
case InterpolationType::kFlat:
return out << "flat";
case InterpolationType::kLinear:
@@ -81,7 +81,8 @@
/// ParseInterpolationSampling parses a InterpolationSampling from a string.
/// @param str the string to parse
-/// @returns the parsed enum, or InterpolationSampling::kInvalid if the string could not be parsed.
+/// @returns the parsed enum, or InterpolationSampling::kUndefined if the string could not be
+/// parsed.
InterpolationSampling ParseInterpolationSampling(std::string_view str) {
if (str == "center") {
return InterpolationSampling::kCenter;
@@ -92,13 +93,13 @@
if (str == "sample") {
return InterpolationSampling::kSample;
}
- return InterpolationSampling::kInvalid;
+ return InterpolationSampling::kUndefined;
}
std::ostream& operator<<(std::ostream& out, InterpolationSampling value) {
switch (value) {
- case InterpolationSampling::kInvalid:
- return out << "invalid";
+ case InterpolationSampling::kUndefined:
+ return out << "undefined";
case InterpolationSampling::kCenter:
return out << "center";
case InterpolationSampling::kCentroid:
diff --git a/src/tint/ast/interpolate_attribute.h b/src/tint/ast/interpolate_attribute.h
index c6b4af0..dd60156 100644
--- a/src/tint/ast/interpolate_attribute.h
+++ b/src/tint/ast/interpolate_attribute.h
@@ -32,7 +32,7 @@
/// The interpolation type.
enum class InterpolationType {
- kInvalid,
+ kUndefined,
kFlat,
kLinear,
kPerspective,
@@ -45,7 +45,7 @@
/// ParseInterpolationType parses a InterpolationType from a string.
/// @param str the string to parse
-/// @returns the parsed enum, or InterpolationType::kInvalid if the string could not be parsed.
+/// @returns the parsed enum, or InterpolationType::kUndefined if the string could not be parsed.
InterpolationType ParseInterpolationType(std::string_view str);
constexpr const char* kInterpolationTypeStrings[] = {
@@ -56,7 +56,7 @@
/// The interpolation sampling.
enum class InterpolationSampling {
- kInvalid,
+ kUndefined,
kCenter,
kCentroid,
kSample,
@@ -69,7 +69,8 @@
/// ParseInterpolationSampling parses a InterpolationSampling from a string.
/// @param str the string to parse
-/// @returns the parsed enum, or InterpolationSampling::kInvalid if the string could not be parsed.
+/// @returns the parsed enum, or InterpolationSampling::kUndefined if the string could not be
+/// parsed.
InterpolationSampling ParseInterpolationSampling(std::string_view str);
constexpr const char* kInterpolationSamplingStrings[] = {
diff --git a/src/tint/ast/pointer.cc b/src/tint/ast/pointer.cc
index 96bbdaf..71b7004 100644
--- a/src/tint/ast/pointer.cc
+++ b/src/tint/ast/pointer.cc
@@ -35,7 +35,7 @@
out << address_space << ", ";
}
out << type->FriendlyName(symbols);
- if (access != ast::Access::kInvalid) {
+ if (access != ast::Access::kUndefined) {
out << ", " << access;
}
out << ">";
diff --git a/src/tint/ast/pointer_test.cc b/src/tint/ast/pointer_test.cc
index 56a04b0..aea260a 100644
--- a/src/tint/ast/pointer_test.cc
+++ b/src/tint/ast/pointer_test.cc
@@ -32,7 +32,7 @@
TEST_F(AstPointerTest, FriendlyName) {
auto* i32 = create<I32>();
- auto* p = create<Pointer>(i32, ast::AddressSpace::kWorkgroup, Access::kInvalid);
+ auto* p = create<Pointer>(i32, ast::AddressSpace::kWorkgroup, Access::kUndefined);
EXPECT_EQ(p->FriendlyName(Symbols()), "ptr<workgroup, i32>");
}
diff --git a/src/tint/ast/storage_texture.cc b/src/tint/ast/storage_texture.cc
index 9c223c3..c9d26c2 100644
--- a/src/tint/ast/storage_texture.cc
+++ b/src/tint/ast/storage_texture.cc
@@ -76,7 +76,7 @@
return builder.create<F32>();
}
- case TexelFormat::kInvalid:
+ case TexelFormat::kUndefined:
break;
}
diff --git a/src/tint/ast/texel_format.cc b/src/tint/ast/texel_format.cc
index 201cad3..587cf29 100644
--- a/src/tint/ast/texel_format.cc
+++ b/src/tint/ast/texel_format.cc
@@ -26,7 +26,7 @@
/// ParseTexelFormat parses a TexelFormat from a string.
/// @param str the string to parse
-/// @returns the parsed enum, or TexelFormat::kInvalid if the string could not be parsed.
+/// @returns the parsed enum, or TexelFormat::kUndefined if the string could not be parsed.
TexelFormat ParseTexelFormat(std::string_view str) {
if (str == "r32float") {
return TexelFormat::kR32Float;
@@ -76,13 +76,13 @@
if (str == "rgba8unorm") {
return TexelFormat::kRgba8Unorm;
}
- return TexelFormat::kInvalid;
+ return TexelFormat::kUndefined;
}
std::ostream& operator<<(std::ostream& out, TexelFormat value) {
switch (value) {
- case TexelFormat::kInvalid:
- return out << "invalid";
+ case TexelFormat::kUndefined:
+ return out << "undefined";
case TexelFormat::kR32Float:
return out << "r32float";
case TexelFormat::kR32Sint:
diff --git a/src/tint/ast/texel_format.h b/src/tint/ast/texel_format.h
index 9c65fb6..fff88a3 100644
--- a/src/tint/ast/texel_format.h
+++ b/src/tint/ast/texel_format.h
@@ -29,7 +29,7 @@
/// Enumerator of texel formats
enum class TexelFormat {
- kInvalid,
+ kUndefined,
kR32Float,
kR32Sint,
kR32Uint,
@@ -55,7 +55,7 @@
/// ParseTexelFormat parses a TexelFormat from a string.
/// @param str the string to parse
-/// @returns the parsed enum, or TexelFormat::kInvalid if the string could not be parsed.
+/// @returns the parsed enum, or TexelFormat::kUndefined if the string could not be parsed.
TexelFormat ParseTexelFormat(std::string_view str);
constexpr const char* kTexelFormatStrings[] = {
diff --git a/src/tint/ast/texel_format_test.cc b/src/tint/ast/texel_format_test.cc
index d431918..d257d5e 100644
--- a/src/tint/ast/texel_format_test.cc
+++ b/src/tint/ast/texel_format_test.cc
@@ -53,30 +53,30 @@
};
static constexpr Case kInvalidCases[] = {
- {"rcc2flot", TexelFormat::kInvalid}, {"3flo3", TexelFormat::kInvalid},
- {"r32flVat", TexelFormat::kInvalid}, {"r32s1nt", TexelFormat::kInvalid},
- {"rq2Jint", TexelFormat::kInvalid}, {"r32sin7ll", TexelFormat::kInvalid},
- {"ppqq2unHH", TexelFormat::kInvalid}, {"r3cv", TexelFormat::kInvalid},
- {"b2uiGt", TexelFormat::kInvalid}, {"rgvi2float", TexelFormat::kInvalid},
- {"rg328WWoat", TexelFormat::kInvalid}, {"rg32lxxMt", TexelFormat::kInvalid},
- {"rgXggsnt", TexelFormat::kInvalid}, {"rgXsnu", TexelFormat::kInvalid},
- {"rg32s3nt", TexelFormat::kInvalid}, {"rg3Euint", TexelFormat::kInvalid},
- {"PP32TTint", TexelFormat::kInvalid}, {"xxg32ddnt", TexelFormat::kInvalid},
- {"rgba446float", TexelFormat::kInvalid}, {"SSVVba16float", TexelFormat::kInvalid},
- {"rgbRR6float", TexelFormat::kInvalid}, {"rga16Fint", TexelFormat::kInvalid},
- {"rgb16sint", TexelFormat::kInvalid}, {"ORVHa16sint", TexelFormat::kInvalid},
- {"ryba1uint", TexelFormat::kInvalid}, {"r77ba1nnullrrt", TexelFormat::kInvalid},
- {"rgb4006uint", TexelFormat::kInvalid}, {"rboofloat", TexelFormat::kInvalid},
- {"rgbaz2loat", TexelFormat::kInvalid}, {"ppga3ii1floa", TexelFormat::kInvalid},
- {"XXgba32sint", TexelFormat::kInvalid}, {"IIgb9932nni55t", TexelFormat::kInvalid},
- {"rYbaSSrrsiHHat", TexelFormat::kInvalid}, {"rbkk2Hit", TexelFormat::kInvalid},
- {"jgba3ugRR", TexelFormat::kInvalid}, {"rgbab2ui", TexelFormat::kInvalid},
- {"rgba8sijt", TexelFormat::kInvalid}, {"rba8sint", TexelFormat::kInvalid},
- {"rba8sqt", TexelFormat::kInvalid}, {"rgba8NNnom", TexelFormat::kInvalid},
- {"rga8vvorm", TexelFormat::kInvalid}, {"rgba8snorQ", TexelFormat::kInvalid},
- {"rgbauirf", TexelFormat::kInvalid}, {"rgbajuint", TexelFormat::kInvalid},
- {"wNNgbauin2", TexelFormat::kInvalid}, {"rgba8unrm", TexelFormat::kInvalid},
- {"rgba8urrorm", TexelFormat::kInvalid}, {"rgba8Gnorm", TexelFormat::kInvalid},
+ {"rcc2flot", TexelFormat::kUndefined}, {"3flo3", TexelFormat::kUndefined},
+ {"r32flVat", TexelFormat::kUndefined}, {"r32s1nt", TexelFormat::kUndefined},
+ {"rq2Jint", TexelFormat::kUndefined}, {"r32sin7ll", TexelFormat::kUndefined},
+ {"ppqq2unHH", TexelFormat::kUndefined}, {"r3cv", TexelFormat::kUndefined},
+ {"b2uiGt", TexelFormat::kUndefined}, {"rgvi2float", TexelFormat::kUndefined},
+ {"rg328WWoat", TexelFormat::kUndefined}, {"rg32lxxMt", TexelFormat::kUndefined},
+ {"rgXggsnt", TexelFormat::kUndefined}, {"rgXsnu", TexelFormat::kUndefined},
+ {"rg32s3nt", TexelFormat::kUndefined}, {"rg3Euint", TexelFormat::kUndefined},
+ {"PP32TTint", TexelFormat::kUndefined}, {"xxg32ddnt", TexelFormat::kUndefined},
+ {"rgba446float", TexelFormat::kUndefined}, {"SSVVba16float", TexelFormat::kUndefined},
+ {"rgbRR6float", TexelFormat::kUndefined}, {"rga16Fint", TexelFormat::kUndefined},
+ {"rgb16sint", TexelFormat::kUndefined}, {"ORVHa16sint", TexelFormat::kUndefined},
+ {"ryba1uint", TexelFormat::kUndefined}, {"r77ba1nnullrrt", TexelFormat::kUndefined},
+ {"rgb4006uint", TexelFormat::kUndefined}, {"rboofloat", TexelFormat::kUndefined},
+ {"rgbaz2loat", TexelFormat::kUndefined}, {"ppga3ii1floa", TexelFormat::kUndefined},
+ {"XXgba32sint", TexelFormat::kUndefined}, {"IIgb9932nni55t", TexelFormat::kUndefined},
+ {"rYbaSSrrsiHHat", TexelFormat::kUndefined}, {"rbkk2Hit", TexelFormat::kUndefined},
+ {"jgba3ugRR", TexelFormat::kUndefined}, {"rgbab2ui", TexelFormat::kUndefined},
+ {"rgba8sijt", TexelFormat::kUndefined}, {"rba8sint", TexelFormat::kUndefined},
+ {"rba8sqt", TexelFormat::kUndefined}, {"rgba8NNnom", TexelFormat::kUndefined},
+ {"rga8vvorm", TexelFormat::kUndefined}, {"rgba8snorQ", TexelFormat::kUndefined},
+ {"rgbauirf", TexelFormat::kUndefined}, {"rgbajuint", TexelFormat::kUndefined},
+ {"wNNgbauin2", TexelFormat::kUndefined}, {"rgba8unrm", TexelFormat::kUndefined},
+ {"rgba8urrorm", TexelFormat::kUndefined}, {"rgba8Gnorm", TexelFormat::kUndefined},
};
using TexelFormatParseTest = testing::TestWithParam<Case>;
diff --git a/src/tint/inspector/inspector.cc b/src/tint/inspector/inspector.cc
index ddb5b11..228c235 100644
--- a/src/tint/inspector/inspector.cc
+++ b/src/tint/inspector/inspector.cc
@@ -120,7 +120,7 @@
auto ast_interpolation_type = interpolation_attribute->type;
auto ast_sampling_type = interpolation_attribute->sampling;
if (ast_interpolation_type != ast::InterpolationType::kFlat &&
- ast_sampling_type == ast::InterpolationSampling::kInvalid) {
+ ast_sampling_type == ast::InterpolationSampling::kUndefined) {
ast_sampling_type = ast::InterpolationSampling::kCenter;
}
@@ -135,13 +135,13 @@
case ast::InterpolationType::kFlat:
interpolation_type = InterpolationType::kFlat;
break;
- case ast::InterpolationType::kInvalid:
+ case ast::InterpolationType::kUndefined:
break;
}
auto sampling_type = InterpolationSampling::kUnknown;
switch (ast_sampling_type) {
- case ast::InterpolationSampling::kInvalid:
+ case ast::InterpolationSampling::kUndefined:
sampling_type = InterpolationSampling::kNone;
break;
case ast::InterpolationSampling::kCenter:
diff --git a/src/tint/inspector/inspector_test.cc b/src/tint/inspector/inspector_test.cc
index 7aa017c..23b6085 100644
--- a/src/tint/inspector/inspector_test.cc
+++ b/src/tint/inspector/inspector_test.cc
@@ -1250,7 +1250,7 @@
ast::InterpolationType::kPerspective, ast::InterpolationSampling::kSample,
InterpolationType::kPerspective, InterpolationSampling::kSample},
InspectorGetEntryPointInterpolateTestParams{
- ast::InterpolationType::kPerspective, ast::InterpolationSampling::kInvalid,
+ ast::InterpolationType::kPerspective, ast::InterpolationSampling::kUndefined,
InterpolationType::kPerspective, InterpolationSampling::kCenter},
InspectorGetEntryPointInterpolateTestParams{
ast::InterpolationType::kLinear, ast::InterpolationSampling::kCenter,
@@ -1262,10 +1262,10 @@
ast::InterpolationType::kLinear, ast::InterpolationSampling::kSample,
InterpolationType::kLinear, InterpolationSampling::kSample},
InspectorGetEntryPointInterpolateTestParams{
- ast::InterpolationType::kLinear, ast::InterpolationSampling::kInvalid,
+ ast::InterpolationType::kLinear, ast::InterpolationSampling::kUndefined,
InterpolationType::kLinear, InterpolationSampling::kCenter},
InspectorGetEntryPointInterpolateTestParams{
- ast::InterpolationType::kFlat, ast::InterpolationSampling::kInvalid,
+ ast::InterpolationType::kFlat, ast::InterpolationSampling::kUndefined,
InterpolationType::kFlat, InterpolationSampling::kNone}));
TEST_F(InspectorGetOverrideDefaultValuesTest, Bool) {
diff --git a/src/tint/inspector/resource_binding.cc b/src/tint/inspector/resource_binding.cc
index 6434ac2..a0e89e2 100644
--- a/src/tint/inspector/resource_binding.cc
+++ b/src/tint/inspector/resource_binding.cc
@@ -104,7 +104,7 @@
return ResourceBinding::TexelFormat::kRgba32Sint;
case ast::TexelFormat::kRgba32Float:
return ResourceBinding::TexelFormat::kRgba32Float;
- case ast::TexelFormat::kInvalid:
+ case ast::TexelFormat::kUndefined:
return ResourceBinding::TexelFormat::kNone;
}
return ResourceBinding::TexelFormat::kNone;
diff --git a/src/tint/program_builder.h b/src/tint/program_builder.h
index 2c99b3b..8430698 100644
--- a/src/tint/program_builder.h
+++ b/src/tint/program_builder.h
@@ -173,7 +173,7 @@
const ast::Type* type = nullptr;
ast::AddressSpace address_space = ast::AddressSpace::kNone;
- ast::Access access = ast::Access::kInvalid;
+ ast::Access access = ast::Access::kUndefined;
const ast::Expression* constructor = nullptr;
utils::Vector<const ast::Attribute*, 4> attributes;
@@ -902,7 +902,7 @@
/// @return the pointer to `type` with the given ast::AddressSpace
const ast::Pointer* pointer(const ast::Type* type,
ast::AddressSpace address_space,
- ast::Access access = ast::Access::kInvalid) const {
+ ast::Access access = ast::Access::kUndefined) const {
return builder->create<ast::Pointer>(type, address_space, access);
}
@@ -914,7 +914,7 @@
const ast::Pointer* pointer(const Source& source,
const ast::Type* type,
ast::AddressSpace address_space,
- ast::Access access = ast::Access::kInvalid) const {
+ ast::Access access = ast::Access::kUndefined) const {
return builder->create<ast::Pointer>(source, type, address_space, access);
}
@@ -923,7 +923,7 @@
/// @return the pointer to type `T` with the given ast::AddressSpace.
template <typename T>
const ast::Pointer* pointer(ast::AddressSpace address_space,
- ast::Access access = ast::Access::kInvalid) const {
+ ast::Access access = ast::Access::kUndefined) const {
return pointer(Of<T>(), address_space, access);
}
@@ -934,7 +934,7 @@
template <typename T>
const ast::Pointer* pointer(const Source& source,
ast::AddressSpace address_space,
- ast::Access access = ast::Access::kInvalid) const {
+ ast::Access access = ast::Access::kUndefined) const {
return pointer(source, Of<T>(), address_space, access);
}
@@ -2909,7 +2909,7 @@
const ast::InterpolateAttribute* Interpolate(
const Source& source,
ast::InterpolationType type,
- ast::InterpolationSampling sampling = ast::InterpolationSampling::kInvalid) {
+ ast::InterpolationSampling sampling = ast::InterpolationSampling::kUndefined) {
return create<ast::InterpolateAttribute>(source, type, sampling);
}
@@ -2919,7 +2919,7 @@
/// @returns the interpolate attribute pointer
const ast::InterpolateAttribute* Interpolate(
ast::InterpolationType type,
- ast::InterpolationSampling sampling = ast::InterpolationSampling::kInvalid) {
+ ast::InterpolationSampling sampling = ast::InterpolationSampling::kUndefined) {
return create<ast::InterpolateAttribute>(source_, type, sampling);
}
diff --git a/src/tint/reader/spirv/enum_converter.cc b/src/tint/reader/spirv/enum_converter.cc
index bc899d7..923f250 100644
--- a/src/tint/reader/spirv/enum_converter.cc
+++ b/src/tint/reader/spirv/enum_converter.cc
@@ -59,7 +59,7 @@
}
Fail() << "unknown SPIR-V storage class: " << uint32_t(sc);
- return ast::AddressSpace::kInvalid;
+ return ast::AddressSpace::kUndefined;
}
ast::BuiltinValue EnumConverter::ToBuiltin(SpvBuiltIn b) {
@@ -93,7 +93,7 @@
}
Fail() << "unknown SPIR-V builtin: " << uint32_t(b);
- return ast::BuiltinValue::kInvalid;
+ return ast::BuiltinValue::kUndefined;
}
ast::TextureDimension EnumConverter::ToDim(SpvDim dim, bool arrayed) {
@@ -129,7 +129,7 @@
ast::TexelFormat EnumConverter::ToTexelFormat(SpvImageFormat fmt) {
switch (fmt) {
case SpvImageFormatUnknown:
- return ast::TexelFormat::kInvalid;
+ return ast::TexelFormat::kUndefined;
// 8 bit channels
case SpvImageFormatRgba8:
@@ -172,7 +172,7 @@
break;
}
Fail() << "invalid image format: " << int(fmt);
- return ast::TexelFormat::kInvalid;
+ return ast::TexelFormat::kUndefined;
}
} // namespace tint::reader::spirv
diff --git a/src/tint/reader/spirv/enum_converter_test.cc b/src/tint/reader/spirv/enum_converter_test.cc
index 623f6ea..112dc4a 100644
--- a/src/tint/reader/spirv/enum_converter_test.cc
+++ b/src/tint/reader/spirv/enum_converter_test.cc
@@ -137,7 +137,7 @@
INSTANTIATE_TEST_SUITE_P(EnumConverterBad,
SpvStorageClassTest,
testing::Values(StorageClassCase{static_cast<SpvStorageClass>(9999), false,
- ast::AddressSpace::kInvalid}));
+ ast::AddressSpace::kUndefined}));
// Builtin
@@ -202,12 +202,14 @@
BuiltinCase{SpvBuiltInFragDepth, true, ast::BuiltinValue::kFragDepth},
BuiltinCase{SpvBuiltInSampleMask, true, ast::BuiltinValue::kSampleMask}));
-INSTANTIATE_TEST_SUITE_P(
- EnumConverterBad,
- SpvBuiltinTest,
- testing::Values(BuiltinCase{static_cast<SpvBuiltIn>(9999), false, ast::BuiltinValue::kInvalid},
- BuiltinCase{static_cast<SpvBuiltIn>(9999), false, ast::BuiltinValue::kInvalid},
- BuiltinCase{SpvBuiltInNumWorkgroups, false, ast::BuiltinValue::kInvalid}));
+INSTANTIATE_TEST_SUITE_P(EnumConverterBad,
+ SpvBuiltinTest,
+ testing::Values(BuiltinCase{static_cast<SpvBuiltIn>(9999), false,
+ ast::BuiltinValue::kUndefined},
+ BuiltinCase{static_cast<SpvBuiltIn>(9999), false,
+ ast::BuiltinValue::kUndefined},
+ BuiltinCase{SpvBuiltInNumWorkgroups, false,
+ ast::BuiltinValue::kUndefined}));
// Dim
@@ -326,7 +328,7 @@
SpvImageFormatTest,
testing::Values(
// Unknown. This is used for sampled images.
- TexelFormatCase{SpvImageFormatUnknown, true, ast::TexelFormat::kInvalid},
+ TexelFormatCase{SpvImageFormatUnknown, true, ast::TexelFormat::kUndefined},
// 8 bit channels
TexelFormatCase{SpvImageFormatRgba8, true, ast::TexelFormat::kRgba8Unorm},
TexelFormatCase{SpvImageFormatRgba8Snorm, true, ast::TexelFormat::kRgba8Snorm},
@@ -355,23 +357,23 @@
SpvImageFormatTest,
testing::Values(
// Scanning in order from the SPIR-V spec.
- TexelFormatCase{SpvImageFormatRg16f, false, ast::TexelFormat::kInvalid},
- TexelFormatCase{SpvImageFormatR11fG11fB10f, false, ast::TexelFormat::kInvalid},
- TexelFormatCase{SpvImageFormatR16f, false, ast::TexelFormat::kInvalid},
- TexelFormatCase{SpvImageFormatRgb10A2, false, ast::TexelFormat::kInvalid},
- TexelFormatCase{SpvImageFormatRg16, false, ast::TexelFormat::kInvalid},
- TexelFormatCase{SpvImageFormatRg8, false, ast::TexelFormat::kInvalid},
- TexelFormatCase{SpvImageFormatR16, false, ast::TexelFormat::kInvalid},
- TexelFormatCase{SpvImageFormatR8, false, ast::TexelFormat::kInvalid},
- TexelFormatCase{SpvImageFormatRgba16Snorm, false, ast::TexelFormat::kInvalid},
- TexelFormatCase{SpvImageFormatRg16Snorm, false, ast::TexelFormat::kInvalid},
- TexelFormatCase{SpvImageFormatRg8Snorm, false, ast::TexelFormat::kInvalid},
- TexelFormatCase{SpvImageFormatRg16i, false, ast::TexelFormat::kInvalid},
- TexelFormatCase{SpvImageFormatRg8i, false, ast::TexelFormat::kInvalid},
- TexelFormatCase{SpvImageFormatR8i, false, ast::TexelFormat::kInvalid},
- TexelFormatCase{SpvImageFormatRgb10a2ui, false, ast::TexelFormat::kInvalid},
- TexelFormatCase{SpvImageFormatRg16ui, false, ast::TexelFormat::kInvalid},
- TexelFormatCase{SpvImageFormatRg8ui, false, ast::TexelFormat::kInvalid}));
+ TexelFormatCase{SpvImageFormatRg16f, false, ast::TexelFormat::kUndefined},
+ TexelFormatCase{SpvImageFormatR11fG11fB10f, false, ast::TexelFormat::kUndefined},
+ TexelFormatCase{SpvImageFormatR16f, false, ast::TexelFormat::kUndefined},
+ TexelFormatCase{SpvImageFormatRgb10A2, false, ast::TexelFormat::kUndefined},
+ TexelFormatCase{SpvImageFormatRg16, false, ast::TexelFormat::kUndefined},
+ TexelFormatCase{SpvImageFormatRg8, false, ast::TexelFormat::kUndefined},
+ TexelFormatCase{SpvImageFormatR16, false, ast::TexelFormat::kUndefined},
+ TexelFormatCase{SpvImageFormatR8, false, ast::TexelFormat::kUndefined},
+ TexelFormatCase{SpvImageFormatRgba16Snorm, false, ast::TexelFormat::kUndefined},
+ TexelFormatCase{SpvImageFormatRg16Snorm, false, ast::TexelFormat::kUndefined},
+ TexelFormatCase{SpvImageFormatRg8Snorm, false, ast::TexelFormat::kUndefined},
+ TexelFormatCase{SpvImageFormatRg16i, false, ast::TexelFormat::kUndefined},
+ TexelFormatCase{SpvImageFormatRg8i, false, ast::TexelFormat::kUndefined},
+ TexelFormatCase{SpvImageFormatR8i, false, ast::TexelFormat::kUndefined},
+ TexelFormatCase{SpvImageFormatRgb10a2ui, false, ast::TexelFormat::kUndefined},
+ TexelFormatCase{SpvImageFormatRg16ui, false, ast::TexelFormat::kUndefined},
+ TexelFormatCase{SpvImageFormatRg8ui, false, ast::TexelFormat::kUndefined}));
} // namespace
} // namespace tint::reader::spirv
diff --git a/src/tint/reader/spirv/function.cc b/src/tint/reader/spirv/function.cc
index 7bbb5df..aef4a4a 100644
--- a/src/tint/reader/spirv/function.cc
+++ b/src/tint/reader/spirv/function.cc
@@ -4854,7 +4854,7 @@
}
// Local variables are always Function storage class, with default
// access mode.
- return DefInfo::Pointer{ast::AddressSpace::kFunction, ast::Access::kInvalid};
+ return DefInfo::Pointer{ast::AddressSpace::kFunction, ast::Access::kUndefined};
}
case SpvOpFunctionParameter: {
const auto* type = As<Pointer>(parser_impl_.ConvertType(inst.type_id()));
@@ -4862,7 +4862,7 @@
// Using kUndefined is ok for now, since the only non-default access mode
// on a pointer would be for a storage buffer, and baseline SPIR-V doesn't
// allow passing pointers to buffers as function parameters.
- return DefInfo::Pointer{type->address_space, ast::Access::kInvalid};
+ return DefInfo::Pointer{type->address_space, ast::Access::kUndefined};
}
default:
break;
@@ -5086,7 +5086,7 @@
// Avoid moving combinatorial values across constructs. This is a
// simple heuristic to avoid changing the cost of an operation
// by moving it into or out of a loop, for example.
- if ((def_info->pointer.address_space == ast::AddressSpace::kInvalid) &&
+ if ((def_info->pointer.address_space == ast::AddressSpace::kUndefined) &&
local_def.used_in_another_construct) {
should_hoist_to_let = true;
}
diff --git a/src/tint/reader/spirv/function.h b/src/tint/reader/spirv/function.h
index b8240cf..9c9c832 100644
--- a/src/tint/reader/spirv/function.h
+++ b/src/tint/reader/spirv/function.h
@@ -332,10 +332,10 @@
/// buffer expressed in the old style (with Uniform address space)
/// that needs to be remapped to StorageBuffer address space.
/// This is kInvalid for non-pointers.
- ast::AddressSpace address_space = ast::AddressSpace::kInvalid;
+ ast::AddressSpace address_space = ast::AddressSpace::kUndefined;
/// The declared access mode.
- ast::Access access = ast::Access::kInvalid;
+ ast::Access access = ast::Access::kUndefined;
};
/// The expression to use when sinking pointers into their use.
diff --git a/src/tint/reader/spirv/parser_impl.cc b/src/tint/reader/spirv/parser_impl.cc
index 63e5cb4..42c5c7d 100644
--- a/src/tint/reader/spirv/parser_impl.cc
+++ b/src/tint/reader/spirv/parser_impl.cc
@@ -1207,7 +1207,7 @@
}
auto ast_address_space = enum_converter_.ToAddressSpace(storage_class);
- if (ast_address_space == ast::AddressSpace::kInvalid) {
+ if (ast_address_space == ast::AddressSpace::kUndefined) {
Fail() << "SPIR-V pointer type with ID " << type_id << " has invalid storage class "
<< static_cast<uint32_t>(storage_class);
return nullptr;
@@ -1567,7 +1567,7 @@
return nullptr;
}
- ast::Access access = ast::Access::kInvalid;
+ ast::Access access = ast::Access::kUndefined;
if (address_space == ast::AddressSpace::kStorage) {
bool read_only = false;
if (auto* tn = storage_type->As<Named>()) {
@@ -1678,7 +1678,7 @@
break;
}
auto ast_builtin = enum_converter_.ToBuiltin(spv_builtin);
- if (ast_builtin == ast::BuiltinValue::kInvalid) {
+ if (ast_builtin == ast::BuiltinValue::kUndefined) {
// A diagnostic has already been emitted.
return false;
}
@@ -1750,7 +1750,7 @@
AttributeList* attributes) {
// Vulkan defaults to perspective-correct interpolation.
ast::InterpolationType type = ast::InterpolationType::kPerspective;
- ast::InterpolationSampling sampling = ast::InterpolationSampling::kInvalid;
+ ast::InterpolationSampling sampling = ast::InterpolationSampling::kUndefined;
for (const auto& deco : decorations) {
TINT_ASSERT(Reader, deco.size() > 0);
@@ -1805,7 +1805,7 @@
// Apply interpolation.
if (type == ast::InterpolationType::kPerspective &&
- sampling == ast::InterpolationSampling::kInvalid) {
+ sampling == ast::InterpolationSampling::kUndefined) {
// This is the default. Don't add a decoration.
} else {
attributes->Push(create<ast::InterpolateAttribute>(type, sampling));
@@ -2477,7 +2477,7 @@
} else {
const auto access = ast::Access::kWrite;
const auto format = enum_converter_.ToTexelFormat(image_type->format());
- if (format == ast::TexelFormat::kInvalid) {
+ if (format == ast::TexelFormat::kUndefined) {
return nullptr;
}
ast_store_type = ty_.StorageTexture(dim, format, access);
diff --git a/src/tint/reader/wgsl/parser_impl.cc b/src/tint/reader/wgsl/parser_impl.cc
index b042ac2..3dad333 100644
--- a/src/tint/reader/wgsl/parser_impl.cc
+++ b/src/tint/reader/wgsl/parser_impl.cc
@@ -383,7 +383,7 @@
return add_error(t.source(), "enable directives don't take parenthesis");
}
- auto extension = ast::Extension::kInvalid;
+ auto extension = ast::Extension::kUndefined;
if (t.Is(Token::Type::kF16)) {
// `f16` is a valid extension name and also a keyword
synchronized_ = true;
@@ -991,7 +991,7 @@
}
return VariableQualifier{sc.value, ac.value};
}
- return Expect<VariableQualifier>{VariableQualifier{sc.value, ast::Access::kInvalid},
+ return Expect<VariableQualifier>{VariableQualifier{sc.value, ast::Access::kUndefined},
source};
});
@@ -1179,7 +1179,7 @@
auto& t = peek();
if (t.IsIdentifier()) {
auto val = parse(t.to_str());
- if (val != ENUM::kInvalid) {
+ if (val != ENUM::kUndefined) {
synchronized_ = true;
next();
return {val, t.source()};
@@ -1247,7 +1247,7 @@
const char* use = "ptr declaration";
auto address_space = ast::AddressSpace::kNone;
- auto access = ast::Access::kInvalid;
+ auto access = ast::Access::kUndefined;
auto subtype = expect_lt_gt_block(use, [&]() -> Expect<const ast::Type*> {
auto sc = expect_address_space(use);
@@ -3512,7 +3512,7 @@
return Failure::kErrored;
}
- ast::InterpolationSampling sampling = ast::InterpolationSampling::kInvalid;
+ ast::InterpolationSampling sampling = ast::InterpolationSampling::kUndefined;
if (match(Token::Type::kComma)) {
if (!peek_is(Token::Type::kParenRight)) {
auto sample = expect_interpolation_sample_name();
diff --git a/src/tint/reader/wgsl/parser_impl.h b/src/tint/reader/wgsl/parser_impl.h
index 77196a0..60b94de 100644
--- a/src/tint/reader/wgsl/parser_impl.h
+++ b/src/tint/reader/wgsl/parser_impl.h
@@ -296,7 +296,7 @@
/// Variable address space
ast::AddressSpace address_space = ast::AddressSpace::kNone;
/// Variable access control
- ast::Access access = ast::Access::kInvalid;
+ ast::Access access = ast::Access::kUndefined;
/// Variable type
const ast::Type* type = nullptr;
};
@@ -306,7 +306,7 @@
/// The variable's address space
ast::AddressSpace address_space = ast::AddressSpace::kNone;
/// The variable's access control
- ast::Access access = ast::Access::kInvalid;
+ ast::Access access = ast::Access::kUndefined;
};
/// MatrixDimensions contains the column and row information for a matrix
diff --git a/src/tint/reader/wgsl/parser_impl_variable_attribute_test.cc b/src/tint/reader/wgsl/parser_impl_variable_attribute_test.cc
index 70af3b2..4c68f9b 100644
--- a/src/tint/reader/wgsl/parser_impl_variable_attribute_test.cc
+++ b/src/tint/reader/wgsl/parser_impl_variable_attribute_test.cc
@@ -227,7 +227,7 @@
auto* interp = var_attr->As<ast::InterpolateAttribute>();
EXPECT_EQ(interp->type, ast::InterpolationType::kFlat);
- EXPECT_EQ(interp->sampling, ast::InterpolationSampling::kInvalid);
+ EXPECT_EQ(interp->sampling, ast::InterpolationSampling::kUndefined);
}
TEST_F(ParserImplTest, Attribute_Interpolate_Single_TrailingComma) {
@@ -243,7 +243,7 @@
auto* interp = var_attr->As<ast::InterpolateAttribute>();
EXPECT_EQ(interp->type, ast::InterpolationType::kFlat);
- EXPECT_EQ(interp->sampling, ast::InterpolationSampling::kInvalid);
+ EXPECT_EQ(interp->sampling, ast::InterpolationSampling::kUndefined);
}
TEST_F(ParserImplTest, Attribute_Interpolate_Single_DoubleTrailingComma) {
diff --git a/src/tint/reader/wgsl/parser_impl_variable_qualifier_test.cc b/src/tint/reader/wgsl/parser_impl_variable_qualifier_test.cc
index 32c1a54..5c0cd5e 100644
--- a/src/tint/reader/wgsl/parser_impl_variable_qualifier_test.cc
+++ b/src/tint/reader/wgsl/parser_impl_variable_qualifier_test.cc
@@ -47,11 +47,11 @@
ParserImplTest,
VariableQualifierTest,
testing::Values(
- VariableStorageData{"uniform", ast::AddressSpace::kUniform, ast::Access::kInvalid},
- VariableStorageData{"workgroup", ast::AddressSpace::kWorkgroup, ast::Access::kInvalid},
- VariableStorageData{"storage", ast::AddressSpace::kStorage, ast::Access::kInvalid},
- VariableStorageData{"private", ast::AddressSpace::kPrivate, ast::Access::kInvalid},
- VariableStorageData{"function", ast::AddressSpace::kFunction, ast::Access::kInvalid},
+ VariableStorageData{"uniform", ast::AddressSpace::kUniform, ast::Access::kUndefined},
+ VariableStorageData{"workgroup", ast::AddressSpace::kWorkgroup, ast::Access::kUndefined},
+ VariableStorageData{"storage", ast::AddressSpace::kStorage, ast::Access::kUndefined},
+ VariableStorageData{"private", ast::AddressSpace::kPrivate, ast::Access::kUndefined},
+ VariableStorageData{"function", ast::AddressSpace::kFunction, ast::Access::kUndefined},
VariableStorageData{"storage, read", ast::AddressSpace::kStorage, ast::Access::kRead},
VariableStorageData{"storage, write", ast::AddressSpace::kStorage, ast::Access::kWrite},
VariableStorageData{"storage, read_write", ast::AddressSpace::kStorage,
diff --git a/src/tint/resolver/attribute_validation_test.cc b/src/tint/resolver/attribute_validation_test.cc
index 018dbfd..dbc9b5d 100644
--- a/src/tint/resolver/attribute_validation_test.cc
+++ b/src/tint/resolver/attribute_validation_test.cc
@@ -721,7 +721,7 @@
}
TEST_F(StructMemberAttributeTest, Align_Attribute_Var) {
- GlobalVar(Source{{1, 2}}, "val", ty.f32(), ast::AddressSpace::kPrivate, ast::Access::kInvalid,
+ GlobalVar(Source{{1, 2}}, "val", ty.f32(), ast::AddressSpace::kPrivate, ast::Access::kUndefined,
Expr(1.23_f));
Structure(Source{{6, 4}}, "mystruct",
@@ -1386,16 +1386,16 @@
ResolverAttributeValidationTest,
InterpolateParameterTest,
testing::Values(
- Params{ast::InterpolationType::kPerspective, ast::InterpolationSampling::kInvalid, true},
+ Params{ast::InterpolationType::kPerspective, ast::InterpolationSampling::kUndefined, true},
Params{ast::InterpolationType::kPerspective, ast::InterpolationSampling::kCenter, true},
Params{ast::InterpolationType::kPerspective, ast::InterpolationSampling::kCentroid, true},
Params{ast::InterpolationType::kPerspective, ast::InterpolationSampling::kSample, true},
- Params{ast::InterpolationType::kLinear, ast::InterpolationSampling::kInvalid, true},
+ Params{ast::InterpolationType::kLinear, ast::InterpolationSampling::kUndefined, true},
Params{ast::InterpolationType::kLinear, ast::InterpolationSampling::kCenter, true},
Params{ast::InterpolationType::kLinear, ast::InterpolationSampling::kCentroid, true},
Params{ast::InterpolationType::kLinear, ast::InterpolationSampling::kSample, true},
// flat interpolation must not have a sampling type
- Params{ast::InterpolationType::kFlat, ast::InterpolationSampling::kInvalid, true},
+ Params{ast::InterpolationType::kFlat, ast::InterpolationSampling::kUndefined, true},
Params{ast::InterpolationType::kFlat, ast::InterpolationSampling::kCenter, false},
Params{ast::InterpolationType::kFlat, ast::InterpolationSampling::kCentroid, false},
Params{ast::InterpolationType::kFlat, ast::InterpolationSampling::kSample, false}));
@@ -1443,7 +1443,7 @@
utils::Vector{
Builtin(ast::BuiltinValue::kPosition),
Interpolate(Source{{12, 34}}, ast::InterpolationType::kFlat,
- ast::InterpolationSampling::kInvalid),
+ ast::InterpolationSampling::kUndefined),
}),
},
ty.void_(), utils::Empty,
@@ -1467,7 +1467,7 @@
utils::Vector{
Builtin(ast::BuiltinValue::kPosition),
Interpolate(Source{{12, 34}}, ast::InterpolationType::kFlat,
- ast::InterpolationSampling::kInvalid),
+ ast::InterpolationSampling::kUndefined),
});
EXPECT_FALSE(r()->Resolve());
@@ -1480,7 +1480,7 @@
utils::Vector{
Member("a", ty.f32(),
utils::Vector{Interpolate(Source{{12, 34}}, ast::InterpolationType::kFlat,
- ast::InterpolationSampling::kInvalid)}),
+ ast::InterpolationSampling::kUndefined)}),
});
EXPECT_FALSE(r()->Resolve());
diff --git a/src/tint/resolver/intrinsic_table.cc b/src/tint/resolver/intrinsic_table.cc
index a82f9e8..6a190de 100644
--- a/src/tint/resolver/intrinsic_table.cc
+++ b/src/tint/resolver/intrinsic_table.cc
@@ -1186,7 +1186,7 @@
for (auto& p : match.parameters) {
params.Push(builder.create<sem::Parameter>(
nullptr, static_cast<uint32_t>(params.Length()), p.type, ast::AddressSpace::kNone,
- ast::Access::kInvalid, p.usage));
+ ast::Access::kUndefined, p.usage));
}
sem::PipelineStageSet supported_stages;
if (match.overload->flags.Contains(OverloadFlag::kSupportsVertexPipeline)) {
@@ -1384,7 +1384,7 @@
for (auto& p : match.parameters) {
params.Push(builder.create<sem::Parameter>(
nullptr, static_cast<uint32_t>(params.Length()), p.type, ast::AddressSpace::kNone,
- ast::Access::kInvalid, p.usage));
+ ast::Access::kUndefined, p.usage));
}
auto eval_stage = match.overload->const_eval_fn ? sem::EvaluationStage::kConstant
: sem::EvaluationStage::kRuntime;
@@ -1397,9 +1397,9 @@
// Conversion.
auto* target = utils::GetOrCreate(converters, match, [&]() {
- auto param = builder.create<sem::Parameter>(nullptr, 0u, match.parameters[0].type,
- ast::AddressSpace::kNone, ast::Access::kInvalid,
- match.parameters[0].usage);
+ auto param = builder.create<sem::Parameter>(
+ nullptr, 0u, match.parameters[0].type, ast::AddressSpace::kNone,
+ ast::Access::kUndefined, match.parameters[0].usage);
auto eval_stage = match.overload->const_eval_fn ? sem::EvaluationStage::kConstant
: sem::EvaluationStage::kRuntime;
return builder.create<sem::TypeConversion>(match.return_type, param, eval_stage);
diff --git a/src/tint/resolver/resolver.cc b/src/tint/resolver/resolver.cc
index 2788fc9..e51f814 100644
--- a/src/tint/resolver/resolver.cc
+++ b/src/tint/resolver/resolver.cc
@@ -251,7 +251,7 @@
[&](const ast::Pointer* t) -> sem::Pointer* {
if (auto* el = Type(t->type)) {
auto access = t->access;
- if (access == ast::Access::kInvalid) {
+ if (access == ast::Access::kUndefined) {
access = DefaultAccessForAddressSpace(t->address_space);
}
return builder_->create<sem::Pointer>(el, t->address_space, access);
@@ -386,12 +386,13 @@
sem::Variable* sem = nullptr;
if (is_global) {
sem = builder_->create<sem::GlobalVariable>(
- v, ty, sem::EvaluationStage::kRuntime, ast::AddressSpace::kNone, ast::Access::kInvalid,
+ v, ty, sem::EvaluationStage::kRuntime, ast::AddressSpace::kNone,
+ ast::Access::kUndefined,
/* constant_value */ nullptr, sem::BindingPoint{}, std::nullopt);
} else {
sem = builder_->create<sem::LocalVariable>(v, ty, sem::EvaluationStage::kRuntime,
- ast::AddressSpace::kNone, ast::Access::kInvalid,
- current_statement_,
+ ast::AddressSpace::kNone,
+ ast::Access::kUndefined, current_statement_,
/* constant_value */ nullptr);
}
@@ -441,7 +442,7 @@
}
auto* sem = builder_->create<sem::GlobalVariable>(
- v, ty, sem::EvaluationStage::kOverride, ast::AddressSpace::kNone, ast::Access::kInvalid,
+ v, ty, sem::EvaluationStage::kOverride, ast::AddressSpace::kNone, ast::Access::kUndefined,
/* constant_value */ nullptr, sem::BindingPoint{}, std::nullopt);
sem->SetConstructor(rhs);
@@ -526,10 +527,10 @@
auto* sem = is_global ? static_cast<sem::Variable*>(builder_->create<sem::GlobalVariable>(
c, ty, sem::EvaluationStage::kConstant, ast::AddressSpace::kNone,
- ast::Access::kInvalid, value, sem::BindingPoint{}, std::nullopt))
+ ast::Access::kUndefined, value, sem::BindingPoint{}, std::nullopt))
: static_cast<sem::Variable*>(builder_->create<sem::LocalVariable>(
c, ty, sem::EvaluationStage::kConstant, ast::AddressSpace::kNone,
- ast::Access::kInvalid, current_statement_, value));
+ ast::Access::kUndefined, current_statement_, value));
sem->SetConstructor(rhs);
builder_->Sem().Add(c, sem);
@@ -588,7 +589,7 @@
}
auto access = var->declared_access;
- if (access == ast::Access::kInvalid) {
+ if (access == ast::Access::kUndefined) {
access = DefaultAccessForAddressSpace(address_space);
}
@@ -752,9 +753,9 @@
location = c->As<uint32_t>();
}
- auto* sem = builder_->create<sem::Parameter>(param, index, ty, ast::AddressSpace::kNone,
- ast::Access::kInvalid, sem::ParameterUsage::kNone,
- binding_point, location);
+ auto* sem = builder_->create<sem::Parameter>(
+ param, index, ty, ast::AddressSpace::kNone, ast::Access::kUndefined,
+ sem::ParameterUsage::kNone, binding_point, location);
builder_->Sem().Add(param, sem);
return sem;
}
@@ -1797,7 +1798,7 @@
static_cast<uint32_t>(i), // index
arr->ElemType(), // type
ast::AddressSpace::kNone, // address_space
- ast::Access::kInvalid);
+ ast::Access::kUndefined);
});
return builder_->create<sem::TypeConstructor>(arr, std::move(params),
args_stage);
@@ -1826,7 +1827,7 @@
static_cast<uint32_t>(i), // index
str->Members()[i]->Type(), // type
ast::AddressSpace::kNone, // address_space
- ast::Access::kInvalid); // access
+ ast::Access::kUndefined); // access
}
return builder_->create<sem::TypeConstructor>(str, std::move(params),
args_stage);
diff --git a/src/tint/resolver/type_validation_test.cc b/src/tint/resolver/type_validation_test.cc
index 1271f06..7cc5cef 100644
--- a/src/tint/resolver/type_validation_test.cc
+++ b/src/tint/resolver/type_validation_test.cc
@@ -1165,7 +1165,7 @@
// var a : texture_storage_1d<ru32int>;
auto* st = ty.storage_texture(Source{{12, 34}}, ast::TextureDimension::k1d,
- ast::TexelFormat::kR32Uint, ast::Access::kInvalid);
+ ast::TexelFormat::kR32Uint, ast::Access::kUndefined);
GlobalVar("a", st, Group(0_a), Binding(0_a));
diff --git a/src/tint/resolver/validator.cc b/src/tint/resolver/validator.cc
index 35ba7e99..6b6b179 100644
--- a/src/tint/resolver/validator.cc
+++ b/src/tint/resolver/validator.cc
@@ -263,7 +263,7 @@
switch (t->access) {
case ast::Access::kWrite:
break;
- case ast::Access::kInvalid:
+ case ast::Access::kUndefined:
AddError("storage texture missing access control", t->source);
return false;
default:
@@ -621,7 +621,7 @@
// https://gpuweb.github.io/gpuweb/wgsl/#variable-declaration
// The access mode always has a default, and except for variables in the storage address
// space, must not be written.
- if (var->declared_access != ast::Access::kInvalid) {
+ if (var->declared_access != ast::Access::kUndefined) {
if (global->AddressSpace() == ast::AddressSpace::kStorage) {
// The access mode for the storage address space can only be 'read' or
// 'read_write'.
@@ -1021,7 +1021,7 @@
}
if (attr->type == ast::InterpolationType::kFlat &&
- attr->sampling != ast::InterpolationSampling::kInvalid) {
+ attr->sampling != ast::InterpolationSampling::kUndefined) {
AddError("flat interpolation attribute must not have a sampling parameter", attr->source);
return false;
}
@@ -1726,7 +1726,7 @@
}
const auto extension = builtin->RequiredExtension();
- if (extension == ast::Extension::kInvalid) {
+ if (extension == ast::Extension::kUndefined) {
return true;
}
diff --git a/src/tint/sem/builtin.cc b/src/tint/sem/builtin.cc
index 5017352..68d8fc8 100644
--- a/src/tint/sem/builtin.cc
+++ b/src/tint/sem/builtin.cc
@@ -182,7 +182,7 @@
if (IsDP4a()) {
return ast::Extension::kChromiumExperimentalDp4A;
}
- return ast::Extension::kInvalid;
+ return ast::Extension::kUndefined;
}
} // namespace tint::sem
diff --git a/src/tint/sem/pointer.cc b/src/tint/sem/pointer.cc
index cb73724..3918233 100644
--- a/src/tint/sem/pointer.cc
+++ b/src/tint/sem/pointer.cc
@@ -25,7 +25,7 @@
Pointer::Pointer(const Type* subtype, ast::AddressSpace address_space, ast::Access access)
: subtype_(subtype), address_space_(address_space), access_(access) {
TINT_ASSERT(Semantic, !subtype->Is<Reference>());
- TINT_ASSERT(Semantic, access != ast::Access::kInvalid);
+ TINT_ASSERT(Semantic, access != ast::Access::kUndefined);
}
size_t Pointer::Hash() const {
diff --git a/src/tint/sem/reference.cc b/src/tint/sem/reference.cc
index 297b779..a3a9f24 100644
--- a/src/tint/sem/reference.cc
+++ b/src/tint/sem/reference.cc
@@ -24,7 +24,7 @@
Reference::Reference(const Type* subtype, ast::AddressSpace address_space, ast::Access access)
: subtype_(subtype), address_space_(address_space), access_(access) {
TINT_ASSERT(Semantic, !subtype->Is<Reference>());
- TINT_ASSERT(Semantic, access != ast::Access::kInvalid);
+ TINT_ASSERT(Semantic, access != ast::Access::kUndefined);
}
size_t Reference::Hash() const {
diff --git a/src/tint/sem/storage_texture.cc b/src/tint/sem/storage_texture.cc
index caa8a79..763eb21 100644
--- a/src/tint/sem/storage_texture.cc
+++ b/src/tint/sem/storage_texture.cc
@@ -75,7 +75,7 @@
return type_mgr.Get<sem::F32>();
}
- case ast::TexelFormat::kInvalid:
+ case ast::TexelFormat::kUndefined:
break;
}
diff --git a/src/tint/symbol_table.h b/src/tint/symbol_table.h
index e07d4df..617266f 100644
--- a/src/tint/symbol_table.h
+++ b/src/tint/symbol_table.h
@@ -52,7 +52,7 @@
/// Returns the symbol for the given `name`
/// @param name the name to lookup
- /// @returns the symbol for the name or symbol::kInvalid if not found.
+ /// @returns the symbol for the name or symbol::kUndefined if not found.
Symbol Get(const std::string& name) const;
/// Returns the name for the given symbol
diff --git a/src/tint/templates/enums.tmpl.inc b/src/tint/templates/enums.tmpl.inc
index 4726d80..d04140b 100644
--- a/src/tint/templates/enums.tmpl.inc
+++ b/src/tint/templates/enums.tmpl.inc
@@ -12,7 +12,7 @@
{{- /* ------------------------------------------------------------------ */ -}}
{{- $enum := PascalCase $.Name -}}
enum class {{$enum}} {
- kInvalid,
+ kUndefined,
{{- range $entry := $.Entries }}
k{{PascalCase $entry.Name}},{{if $entry.IsInternal}} // Tint-internal enum entry - not parsed{{end}}
{{- end }}
@@ -25,7 +25,7 @@
/// Parse{{$enum}} parses a {{$enum}} from a string.
/// @param str the string to parse
-/// @returns the parsed enum, or {{$enum}}::kInvalid if the string could not be parsed.
+/// @returns the parsed enum, or {{$enum}}::kUndefined if the string could not be parsed.
{{$enum}} Parse{{$enum}}(std::string_view str);
constexpr const char* k{{$enum}}Strings[] = {
@@ -47,14 +47,14 @@
{{- $enum := PascalCase $.Name -}}
/// Parse{{$enum}} parses a {{$enum}} from a string.
/// @param str the string to parse
-/// @returns the parsed enum, or {{$enum}}::kInvalid if the string could not be parsed.
+/// @returns the parsed enum, or {{$enum}}::kUndefined if the string could not be parsed.
{{$enum}} Parse{{$enum}}(std::string_view str) {
{{- range $entry := $.PublicEntries }}
if (str == "{{$entry.Name}}") {
return {{template "EnumCase" $entry}};
}
{{- end }}
- return {{$enum}}::kInvalid;
+ return {{$enum}}::kUndefined;
}
{{- end -}}
@@ -67,8 +67,8 @@
{{- $enum := PascalCase $.Name -}}
std::ostream& operator<<(std::ostream& out, {{$enum}} value) {
switch (value) {
- case {{$enum}}::kInvalid:
- return out << "invalid";
+ case {{$enum}}::kUndefined:
+ return out << "undefined";
{{- range $entry := $.Entries }}
case {{template "EnumCase" $entry}}:
return out << "{{$entry.Name}}";
@@ -105,9 +105,9 @@
static constexpr Case kInvalidCases[] = {
{{- $exclude := $.NameSet -}}
{{- range $entry := $.PublicEntries }}
- {"{{Scramble $entry.Name $exclude}}", {{$enum}}::kInvalid},
- {"{{Scramble $entry.Name $exclude}}", {{$enum}}::kInvalid},
- {"{{Scramble $entry.Name $exclude}}", {{$enum}}::kInvalid},
+ {"{{Scramble $entry.Name $exclude}}", {{$enum}}::kUndefined},
+ {"{{Scramble $entry.Name $exclude}}", {{$enum}}::kUndefined},
+ {"{{Scramble $entry.Name $exclude}}", {{$enum}}::kUndefined},
{{- end }}
};
diff --git a/src/tint/transform/binding_remapper.cc b/src/tint/transform/binding_remapper.cc
index 66d8e99..102bb1e 100644
--- a/src/tint/transform/binding_remapper.cc
+++ b/src/tint/transform/binding_remapper.cc
@@ -121,7 +121,7 @@
auto ac_it = remappings->access_controls.find(from);
if (ac_it != remappings->access_controls.end()) {
ast::Access ac = ac_it->second;
- if (ac == ast::Access::kInvalid) {
+ if (ac == ast::Access::kUndefined) {
ctx.dst->Diagnostics().add_error(
diag::System::Transform,
"invalid access mode (" + std::to_string(static_cast<uint32_t>(ac)) + ")");
diff --git a/src/tint/transform/canonicalize_entry_point_io.cc b/src/tint/transform/canonicalize_entry_point_io.cc
index 38a1b28..b990965 100644
--- a/src/tint/transform/canonicalize_entry_point_io.cc
+++ b/src/tint/transform/canonicalize_entry_point_io.cc
@@ -223,7 +223,7 @@
(ast::HasAttribute<ast::LocationAttribute>(attributes) ||
cfg.shader_style == ShaderStyle::kSpirv)) {
attributes.Push(ctx.dst->Interpolate(ast::InterpolationType::kFlat,
- ast::InterpolationSampling::kInvalid));
+ ast::InterpolationSampling::kUndefined));
}
// Disable validation for use of the `input` address space.
@@ -292,7 +292,7 @@
ast::HasAttribute<ast::LocationAttribute>(attributes) &&
!ast::HasAttribute<ast::InterpolateAttribute>(attributes)) {
attributes.Push(ctx.dst->Interpolate(ast::InterpolationType::kFlat,
- ast::InterpolationSampling::kInvalid));
+ ast::InterpolationSampling::kUndefined));
}
// In GLSL, if it's a builtin, override the name with the
diff --git a/src/tint/writer/append_vector.cc b/src/tint/writer/append_vector.cc
index 98e9efc..edf9132 100644
--- a/src/tint/writer/append_vector.cc
+++ b/src/tint/writer/append_vector.cc
@@ -137,7 +137,7 @@
auto* scalar_cast_target = b->create<sem::TypeConversion>(
packed_el_sem_ty,
b->create<sem::Parameter>(nullptr, 0u, scalar_sem->Type()->UnwrapRef(),
- ast::AddressSpace::kNone, ast::Access::kInvalid),
+ ast::AddressSpace::kNone, ast::Access::kUndefined),
sem::EvaluationStage::kRuntime);
auto* scalar_cast_sem = b->create<sem::Call>(
scalar_cast_ast, scalar_cast_target, sem::EvaluationStage::kRuntime,
@@ -158,7 +158,7 @@
[&](const tint::sem::Expression* arg, size_t i) -> const sem::Parameter* {
return b->create<sem::Parameter>(
nullptr, static_cast<uint32_t>(i), arg->Type()->UnwrapRef(),
- ast::AddressSpace::kNone, ast::Access::kInvalid);
+ ast::AddressSpace::kNone, ast::Access::kUndefined);
}),
sem::EvaluationStage::kRuntime);
auto* constructor_sem =
diff --git a/src/tint/writer/glsl/generator_impl.cc b/src/tint/writer/glsl/generator_impl.cc
index da67b3d..25c094b 100644
--- a/src/tint/writer/glsl/generator_impl.cc
+++ b/src/tint/writer/glsl/generator_impl.cc
@@ -141,7 +141,7 @@
return "rgba32i";
case ast::TexelFormat::kRgba32Float:
return "rgba32f";
- case ast::TexelFormat::kInvalid:
+ case ast::TexelFormat::kUndefined:
return "unknown";
}
return "unknown";
@@ -509,20 +509,20 @@
{
auto decl = line(&b);
if (!EmitTypeAndName(decl, ret_ty, ast::AddressSpace::kNone,
- ast::Access::kInvalid, fn_name)) {
+ ast::Access::kUndefined, fn_name)) {
return "";
}
{
ScopedParen sp(decl);
const auto* ty = TypeOf(expr->lhs)->UnwrapRef();
if (!EmitTypeAndName(decl, ty, ast::AddressSpace::kNone,
- ast::Access::kInvalid, "lhs")) {
+ ast::Access::kUndefined, "lhs")) {
return "";
}
decl << ", ";
ty = TypeOf(expr->rhs)->UnwrapRef();
if (!EmitTypeAndName(decl, ty, ast::AddressSpace::kNone,
- ast::Access::kInvalid, "rhs")) {
+ ast::Access::kUndefined, "rhs")) {
return "";
}
}
@@ -935,7 +935,7 @@
{
auto pre = line();
if (!EmitTypeAndName(pre, builtin->ReturnType(), ast::AddressSpace::kNone,
- ast::Access::kInvalid, result)) {
+ ast::Access::kUndefined, result)) {
return false;
}
pre << ";";
@@ -1213,7 +1213,7 @@
{
auto l = line(b);
if (!EmitType(l, builtin->ReturnType(), ast::AddressSpace::kNone,
- ast::Access::kInvalid, "")) {
+ ast::Access::kUndefined, "")) {
return false;
}
l << " result;";
@@ -1239,7 +1239,7 @@
{
auto l = line(b);
if (!EmitType(l, builtin->ReturnType(), ast::AddressSpace::kNone,
- ast::Access::kInvalid, "")) {
+ ast::Access::kUndefined, "")) {
return false;
}
l << " result;";
@@ -2049,7 +2049,7 @@
switch (interpolate->type) {
case ast::InterpolationType::kPerspective:
case ast::InterpolationType::kLinear:
- case ast::InterpolationType::kInvalid:
+ case ast::InterpolationType::kUndefined:
break;
case ast::InterpolationType::kFlat:
out << "flat ";
@@ -2061,7 +2061,7 @@
break;
case ast::InterpolationSampling::kSample:
case ast::InterpolationSampling::kCenter:
- case ast::InterpolationSampling::kInvalid:
+ case ast::InterpolationSampling::kUndefined:
break;
}
}
@@ -2198,7 +2198,7 @@
return true;
},
[&](const sem::Vector* v) {
- if (!EmitType(out, v, ast::AddressSpace::kNone, ast::Access::kInvalid, "")) {
+ if (!EmitType(out, v, ast::AddressSpace::kNone, ast::Access::kUndefined, "")) {
return false;
}
@@ -2219,7 +2219,7 @@
return true;
},
[&](const sem::Matrix* m) {
- if (!EmitType(out, m, ast::AddressSpace::kNone, ast::Access::kInvalid, "")) {
+ if (!EmitType(out, m, ast::AddressSpace::kNone, ast::Access::kUndefined, "")) {
return false;
}
@@ -2236,7 +2236,7 @@
return true;
},
[&](const sem::Array* a) {
- if (!EmitType(out, a, ast::AddressSpace::kNone, ast::Access::kInvalid, "")) {
+ if (!EmitType(out, a, ast::AddressSpace::kNone, ast::Access::kUndefined, "")) {
return false;
}
@@ -2260,7 +2260,7 @@
return true;
},
[&](const sem::Struct* s) {
- if (!EmitType(out, s, ast::AddressSpace::kNone, ast::Access::kInvalid, "")) {
+ if (!EmitType(out, s, ast::AddressSpace::kNone, ast::Access::kUndefined, "")) {
return false;
}
@@ -2351,7 +2351,7 @@
}
}
} else if (auto* str = type->As<sem::Struct>()) {
- if (!EmitType(out, type, ast::AddressSpace::kNone, ast::Access::kInvalid, "")) {
+ if (!EmitType(out, type, ast::AddressSpace::kNone, ast::Access::kUndefined, "")) {
return false;
}
bool first = true;
@@ -2365,7 +2365,7 @@
EmitZeroValue(out, member->Type());
}
} else if (auto* arr = type->As<sem::Array>()) {
- if (!EmitType(out, type, ast::AddressSpace::kNone, ast::Access::kInvalid, "")) {
+ if (!EmitType(out, type, ast::AddressSpace::kNone, ast::Access::kUndefined, "")) {
return false;
}
ScopedParen sp(out);
@@ -2972,7 +2972,7 @@
auto out = line();
// TODO(senorblanco): handle const
- if (!EmitTypeAndName(out, type, ast::AddressSpace::kNone, ast::Access::kInvalid,
+ if (!EmitTypeAndName(out, type, ast::AddressSpace::kNone, ast::Access::kUndefined,
builder_.Symbols().NameFor(let->symbol))) {
return false;
}
@@ -2994,7 +2994,7 @@
auto out = line();
out << "const ";
- if (!EmitTypeAndName(out, type, ast::AddressSpace::kNone, ast::Access::kInvalid,
+ if (!EmitTypeAndName(out, type, ast::AddressSpace::kNone, ast::Access::kUndefined,
builder_.Symbols().NameFor(var->symbol))) {
return false;
}
@@ -3022,7 +3022,7 @@
{
auto decl = line(&b);
if (!EmitTypeAndName(decl, builtin->ReturnType(), ast::AddressSpace::kNone,
- ast::Access::kInvalid, fn_name)) {
+ ast::Access::kUndefined, fn_name)) {
return "";
}
{
@@ -3037,8 +3037,8 @@
decl << "inout ";
ty = ptr->StoreType();
}
- if (!EmitTypeAndName(decl, ty, ast::AddressSpace::kNone, ast::Access::kInvalid,
- param_name)) {
+ if (!EmitTypeAndName(decl, ty, ast::AddressSpace::kNone,
+ ast::Access::kUndefined, param_name)) {
return "";
}
parameter_names.emplace_back(std::move(param_name));
diff --git a/src/tint/writer/hlsl/generator_impl.cc b/src/tint/writer/hlsl/generator_impl.cc
index 94e80e8..b683e1a 100644
--- a/src/tint/writer/hlsl/generator_impl.cc
+++ b/src/tint/writer/hlsl/generator_impl.cc
@@ -325,7 +325,8 @@
std::string fn;
{
std::ostringstream ss;
- if (!EmitType(ss, vec, tint::ast::AddressSpace::kInvalid, ast::Access::kInvalid, "")) {
+ if (!EmitType(ss, vec, tint::ast::AddressSpace::kUndefined, ast::Access::kUndefined,
+ "")) {
return "";
}
fn = UniqueIdentifier("set_" + ss.str());
@@ -333,13 +334,13 @@
{
auto out = line(&helpers_);
out << "void " << fn << "(inout ";
- if (!EmitTypeAndName(out, vec, ast::AddressSpace::kInvalid, ast::Access::kInvalid,
+ if (!EmitTypeAndName(out, vec, ast::AddressSpace::kUndefined, ast::Access::kUndefined,
"vec")) {
return "";
}
out << ", int idx, ";
- if (!EmitTypeAndName(out, vec->type(), ast::AddressSpace::kInvalid,
- ast::Access::kInvalid, "val")) {
+ if (!EmitTypeAndName(out, vec->type(), ast::AddressSpace::kUndefined,
+ ast::Access::kUndefined, "val")) {
return "";
}
out << ") {";
@@ -398,7 +399,8 @@
std::string fn;
{
std::ostringstream ss;
- if (!EmitType(ss, mat, tint::ast::AddressSpace::kInvalid, ast::Access::kInvalid, "")) {
+ if (!EmitType(ss, mat, tint::ast::AddressSpace::kUndefined, ast::Access::kUndefined,
+ "")) {
return "";
}
fn = UniqueIdentifier("set_vector_" + ss.str());
@@ -406,13 +408,13 @@
{
auto out = line(&helpers_);
out << "void " << fn << "(inout ";
- if (!EmitTypeAndName(out, mat, ast::AddressSpace::kInvalid, ast::Access::kInvalid,
+ if (!EmitTypeAndName(out, mat, ast::AddressSpace::kUndefined, ast::Access::kUndefined,
"mat")) {
return "";
}
out << ", int col, ";
- if (!EmitTypeAndName(out, mat->ColumnType(), ast::AddressSpace::kInvalid,
- ast::Access::kInvalid, "val")) {
+ if (!EmitTypeAndName(out, mat->ColumnType(), ast::AddressSpace::kUndefined,
+ ast::Access::kUndefined, "val")) {
return "";
}
out << ") {";
@@ -466,7 +468,8 @@
std::string fn;
{
std::ostringstream ss;
- if (!EmitType(ss, mat, tint::ast::AddressSpace::kInvalid, ast::Access::kInvalid, "")) {
+ if (!EmitType(ss, mat, tint::ast::AddressSpace::kUndefined, ast::Access::kUndefined,
+ "")) {
return "";
}
fn = UniqueIdentifier("set_scalar_" + ss.str());
@@ -474,13 +477,13 @@
{
auto out = line(&helpers_);
out << "void " << fn << "(inout ";
- if (!EmitTypeAndName(out, mat, ast::AddressSpace::kInvalid, ast::Access::kInvalid,
+ if (!EmitTypeAndName(out, mat, ast::AddressSpace::kUndefined, ast::Access::kUndefined,
"mat")) {
return "";
}
out << ", int col, int row, ";
- if (!EmitTypeAndName(out, mat->type(), ast::AddressSpace::kInvalid,
- ast::Access::kInvalid, "val")) {
+ if (!EmitTypeAndName(out, mat->type(), ast::AddressSpace::kUndefined,
+ ast::Access::kUndefined, "val")) {
return "";
}
out << ") {";
@@ -655,7 +658,7 @@
if (auto* vec = ty->As<sem::Vector>()) {
auto* elem_ty = vec->type();
- if (!EmitType(out, ty, ast::AddressSpace::kNone, ast::Access::kInvalid, "")) {
+ if (!EmitType(out, ty, ast::AddressSpace::kNone, ast::Access::kUndefined, "")) {
return false;
}
@@ -720,7 +723,8 @@
std::string ty_name;
{
std::ostringstream ss;
- if (!EmitType(ss, ty, tint::ast::AddressSpace::kInvalid, ast::Access::kInvalid, "")) {
+ if (!EmitType(ss, ty, tint::ast::AddressSpace::kUndefined, ast::Access::kUndefined,
+ "")) {
return "";
}
ty_name = ss.str();
@@ -1428,12 +1432,12 @@
auto rmw = [&](const char* hlsl) -> bool {
{
auto fn = line(&buf);
- if (!EmitTypeAndName(fn, result_ty, ast::AddressSpace::kNone, ast::Access::kInvalid,
+ if (!EmitTypeAndName(fn, result_ty, ast::AddressSpace::kNone, ast::Access::kUndefined,
name)) {
return false;
}
fn << "(RWByteAddressBuffer buffer, uint offset, ";
- if (!EmitTypeAndName(fn, result_ty, ast::AddressSpace::kNone, ast::Access::kInvalid,
+ if (!EmitTypeAndName(fn, result_ty, ast::AddressSpace::kNone, ast::Access::kUndefined,
"value")) {
return false;
}
@@ -1449,7 +1453,7 @@
{
auto l = line(&buf);
- if (!EmitTypeAndName(l, result_ty, ast::AddressSpace::kNone, ast::Access::kInvalid,
+ if (!EmitTypeAndName(l, result_ty, ast::AddressSpace::kNone, ast::Access::kUndefined,
"original_value")) {
return false;
}
@@ -1498,8 +1502,8 @@
// InterlockedOr using 0 as the OR value
{
auto fn = line(&buf);
- if (!EmitTypeAndName(fn, result_ty, ast::AddressSpace::kNone, ast::Access::kInvalid,
- name)) {
+ if (!EmitTypeAndName(fn, result_ty, ast::AddressSpace::kNone,
+ ast::Access::kUndefined, name)) {
return false;
}
fn << "(RWByteAddressBuffer buffer, uint offset) {";
@@ -1514,8 +1518,8 @@
{
auto l = line(&buf);
- if (!EmitTypeAndName(l, result_ty, ast::AddressSpace::kNone, ast::Access::kInvalid,
- "value")) {
+ if (!EmitTypeAndName(l, result_ty, ast::AddressSpace::kNone,
+ ast::Access::kUndefined, "value")) {
return false;
}
l << " = 0;";
@@ -1532,8 +1536,8 @@
{
auto fn = line(&buf);
fn << "void " << name << "(RWByteAddressBuffer buffer, uint offset, ";
- if (!EmitTypeAndName(fn, value_ty, ast::AddressSpace::kNone, ast::Access::kInvalid,
- "value")) {
+ if (!EmitTypeAndName(fn, value_ty, ast::AddressSpace::kNone,
+ ast::Access::kUndefined, "value")) {
return false;
}
fn << ") {";
@@ -1548,7 +1552,7 @@
{
auto l = line(&buf);
- if (!EmitTypeAndName(l, value_ty, ast::AddressSpace::kNone, ast::Access::kInvalid,
+ if (!EmitTypeAndName(l, value_ty, ast::AddressSpace::kNone, ast::Access::kUndefined,
"ignored")) {
return false;
}
@@ -1563,18 +1567,18 @@
auto* value_ty = params[2]->Type()->UnwrapRef();
{
auto fn = line(&buf);
- if (!EmitTypeAndName(fn, result_ty, ast::AddressSpace::kNone, ast::Access::kInvalid,
- name)) {
+ if (!EmitTypeAndName(fn, result_ty, ast::AddressSpace::kNone,
+ ast::Access::kUndefined, name)) {
return false;
}
fn << "(RWByteAddressBuffer buffer, uint offset, ";
- if (!EmitTypeAndName(fn, value_ty, ast::AddressSpace::kNone, ast::Access::kInvalid,
- "compare")) {
+ if (!EmitTypeAndName(fn, value_ty, ast::AddressSpace::kNone,
+ ast::Access::kUndefined, "compare")) {
return false;
}
fn << ", ";
- if (!EmitTypeAndName(fn, value_ty, ast::AddressSpace::kNone, ast::Access::kInvalid,
- "value")) {
+ if (!EmitTypeAndName(fn, value_ty, ast::AddressSpace::kNone,
+ ast::Access::kUndefined, "value")) {
return false;
}
fn << ") {";
@@ -1589,8 +1593,8 @@
{ // T result = {0};
auto l = line(&buf);
- if (!EmitTypeAndName(l, result_ty, ast::AddressSpace::kNone, ast::Access::kInvalid,
- "result")) {
+ if (!EmitTypeAndName(l, result_ty, ast::AddressSpace::kNone,
+ ast::Access::kUndefined, "result")) {
return false;
}
l << "=";
@@ -1625,7 +1629,7 @@
if (!builtin->ReturnType()->Is<sem::Void>()) {
auto pre = line();
if (!EmitTypeAndName(pre, builtin->ReturnType(), ast::AddressSpace::kNone,
- ast::Access::kInvalid, result)) {
+ ast::Access::kUndefined, result)) {
return false;
}
pre << " = ";
@@ -1688,8 +1692,8 @@
{ // T result = 0;
auto pre = line();
auto* value_ty = builtin->Parameters()[1]->Type()->UnwrapRef();
- if (!EmitTypeAndName(pre, value_ty, ast::AddressSpace::kNone, ast::Access::kInvalid,
- result)) {
+ if (!EmitTypeAndName(pre, value_ty, ast::AddressSpace::kNone,
+ ast::Access::kUndefined, result)) {
return false;
}
pre << " = ";
@@ -1729,7 +1733,7 @@
{ // T compare_value = <compare_value>;
auto pre = line();
if (!EmitTypeAndName(pre, TypeOf(compare_value)->UnwrapRef(),
- ast::AddressSpace::kNone, ast::Access::kInvalid, compare)) {
+ ast::AddressSpace::kNone, ast::Access::kUndefined, compare)) {
return false;
}
pre << " = ";
@@ -1839,7 +1843,7 @@
{
auto l = line(b);
if (!EmitType(l, builtin->ReturnType(), ast::AddressSpace::kNone,
- ast::Access::kInvalid, "")) {
+ ast::Access::kUndefined, "")) {
return false;
}
l << " result;";
@@ -1881,7 +1885,7 @@
{
auto l = line(b);
if (!EmitType(l, builtin->ReturnType(), ast::AddressSpace::kNone,
- ast::Access::kInvalid, "")) {
+ ast::Access::kUndefined, "")) {
return false;
}
l << " result = {sig, int" << width << "(exp)};";
@@ -2718,7 +2722,7 @@
auto const* type = v->Type();
auto address_space = ast::AddressSpace::kNone;
- auto access = ast::Access::kInvalid;
+ auto access = ast::Access::kUndefined;
if (auto* ptr = type->As<sem::Pointer>()) {
type = ptr->StoreType();
@@ -3007,7 +3011,7 @@
case ast::InterpolationType::kFlat:
modifiers += "nointerpolation ";
break;
- case ast::InterpolationType::kInvalid:
+ case ast::InterpolationType::kUndefined:
break;
}
switch (sampling) {
@@ -3018,7 +3022,7 @@
modifiers += "sample ";
break;
case ast::InterpolationSampling::kCenter:
- case ast::InterpolationSampling::kInvalid:
+ case ast::InterpolationSampling::kUndefined:
break;
}
return modifiers;
@@ -3140,7 +3144,7 @@
return true;
}
- if (!EmitType(out, v, ast::AddressSpace::kNone, ast::Access::kInvalid, "")) {
+ if (!EmitType(out, v, ast::AddressSpace::kNone, ast::Access::kUndefined, "")) {
return false;
}
@@ -3157,7 +3161,7 @@
return true;
},
[&](const sem::Matrix* m) {
- if (!EmitType(out, m, ast::AddressSpace::kNone, ast::Access::kInvalid, "")) {
+ if (!EmitType(out, m, ast::AddressSpace::kNone, ast::Access::kUndefined, "")) {
return false;
}
@@ -3176,7 +3180,7 @@
[&](const sem::Array* a) {
if (constant->AllZero()) {
out << "(";
- if (!EmitType(out, a, ast::AddressSpace::kNone, ast::Access::kInvalid, "")) {
+ if (!EmitType(out, a, ast::AddressSpace::kNone, ast::Access::kUndefined, "")) {
return false;
}
out << ")0";
@@ -3206,7 +3210,7 @@
[&](const sem::Struct* s) {
if (constant->AllZero()) {
out << "(";
- if (!EmitType(out, s, ast::AddressSpace::kNone, ast::Access::kInvalid, "")) {
+ if (!EmitType(out, s, ast::AddressSpace::kNone, ast::Access::kUndefined, "")) {
return false;
}
out << ")0";
@@ -3327,12 +3331,12 @@
[&](const sem::Struct*) {
out << "(";
TINT_DEFER(out << ")" << value);
- return EmitType(out, type, ast::AddressSpace::kNone, ast::Access::kInvalid, "");
+ return EmitType(out, type, ast::AddressSpace::kNone, ast::Access::kUndefined, "");
},
[&](const sem::Array*) {
out << "(";
TINT_DEFER(out << ")" << value);
- return EmitType(out, type, ast::AddressSpace::kNone, ast::Access::kInvalid, "");
+ return EmitType(out, type, ast::AddressSpace::kNone, ast::Access::kUndefined, "");
},
[&](Default) {
diagnostics_.add_error(
@@ -4080,7 +4084,7 @@
auto out = line();
out << "const ";
- if (!EmitTypeAndName(out, type, ast::AddressSpace::kNone, ast::Access::kInvalid,
+ if (!EmitTypeAndName(out, type, ast::AddressSpace::kNone, ast::Access::kUndefined,
builder_.Symbols().NameFor(let->symbol))) {
return false;
}
@@ -4108,7 +4112,7 @@
{
auto decl = line(&b);
if (!EmitTypeAndName(decl, builtin->ReturnType(), ast::AddressSpace::kNone,
- ast::Access::kInvalid, fn_name)) {
+ ast::Access::kUndefined, fn_name)) {
return "";
}
{
@@ -4123,8 +4127,8 @@
decl << "inout ";
ty = ptr->StoreType();
}
- if (!EmitTypeAndName(decl, ty, ast::AddressSpace::kNone, ast::Access::kInvalid,
- param_name)) {
+ if (!EmitTypeAndName(decl, ty, ast::AddressSpace::kNone,
+ ast::Access::kUndefined, param_name)) {
return "";
}
parameter_names.emplace_back(std::move(param_name));
diff --git a/src/tint/writer/msl/generator_impl.cc b/src/tint/writer/msl/generator_impl.cc
index 5db1d8f..57d5bf0 100644
--- a/src/tint/writer/msl/generator_impl.cc
+++ b/src/tint/writer/msl/generator_impl.cc
@@ -1947,7 +1947,7 @@
case ast::InterpolationSampling::kSample:
attr = "sample_";
break;
- case ast::InterpolationSampling::kInvalid:
+ case ast::InterpolationSampling::kUndefined:
break;
}
switch (type) {
@@ -1960,7 +1960,7 @@
case ast::InterpolationType::kFlat:
attr += "flat";
break;
- case ast::InterpolationType::kInvalid:
+ case ast::InterpolationType::kUndefined:
break;
}
return attr;
diff --git a/src/tint/writer/spirv/builder.cc b/src/tint/writer/spirv/builder.cc
index 57a363d..ab88ca5 100644
--- a/src/tint/writer/spirv/builder.cc
+++ b/src/tint/writer/spirv/builder.cc
@@ -766,7 +766,7 @@
push_annot(spv::Op::OpDecorate,
{Operand(var_id), U32Operand(SpvDecorationNonWritable)});
break;
- case ast::Access::kInvalid:
+ case ast::Access::kUndefined:
case ast::Access::kReadWrite:
break;
}
@@ -4009,7 +4009,7 @@
SpvStorageClass Builder::ConvertAddressSpace(ast::AddressSpace klass) const {
switch (klass) {
- case ast::AddressSpace::kInvalid:
+ case ast::AddressSpace::kUndefined:
return SpvStorageClassMax;
case ast::AddressSpace::kIn:
return SpvStorageClassInput;
@@ -4071,7 +4071,7 @@
return SpvBuiltInSampleId;
case ast::BuiltinValue::kSampleMask:
return SpvBuiltInSampleMask;
- case ast::BuiltinValue::kInvalid:
+ case ast::BuiltinValue::kUndefined:
break;
}
return SpvBuiltInMax;
@@ -4088,7 +4088,7 @@
push_annot(spv::Op::OpDecorate, {Operand(id), U32Operand(SpvDecorationFlat)});
break;
case ast::InterpolationType::kPerspective:
- case ast::InterpolationType::kInvalid:
+ case ast::InterpolationType::kUndefined:
break;
}
switch (sampling) {
@@ -4100,7 +4100,7 @@
push_annot(spv::Op::OpDecorate, {Operand(id), U32Operand(SpvDecorationSample)});
break;
case ast::InterpolationSampling::kCenter:
- case ast::InterpolationSampling::kInvalid:
+ case ast::InterpolationSampling::kUndefined:
break;
}
}
@@ -4142,7 +4142,7 @@
return SpvImageFormatRgba32i;
case ast::TexelFormat::kRgba32Float:
return SpvImageFormatRgba32f;
- case ast::TexelFormat::kInvalid:
+ case ast::TexelFormat::kUndefined:
return SpvImageFormatUnknown;
}
return SpvImageFormatUnknown;
diff --git a/src/tint/writer/spirv/builder_global_variable_test.cc b/src/tint/writer/spirv/builder_global_variable_test.cc
index b0bbf3f..0d2ec9c 100644
--- a/src/tint/writer/spirv/builder_global_variable_test.cc
+++ b/src/tint/writer/spirv/builder_global_variable_test.cc
@@ -270,7 +270,7 @@
BuilderTest_Type,
BuiltinDataTest,
testing::Values(
- BuiltinData{ast::BuiltinValue::kInvalid, ast::AddressSpace::kNone, SpvBuiltInMax},
+ BuiltinData{ast::BuiltinValue::kUndefined, ast::AddressSpace::kNone, SpvBuiltInMax},
BuiltinData{ast::BuiltinValue::kPosition, ast::AddressSpace::kIn, SpvBuiltInFragCoord},
BuiltinData{ast::BuiltinValue::kPosition, ast::AddressSpace::kOut, SpvBuiltInPosition},
BuiltinData{
diff --git a/src/tint/writer/wgsl/generator_impl.cc b/src/tint/writer/wgsl/generator_impl.cc
index cf43f23..56eabc1 100644
--- a/src/tint/writer/wgsl/generator_impl.cc
+++ b/src/tint/writer/wgsl/generator_impl.cc
@@ -346,7 +346,7 @@
bool GeneratorImpl::EmitImageFormat(std::ostream& out, const ast::TexelFormat fmt) {
switch (fmt) {
- case ast::TexelFormat::kInvalid:
+ case ast::TexelFormat::kUndefined:
diagnostics_.add_error(diag::System::Writer, "unknown image format");
return false;
default:
@@ -433,7 +433,7 @@
if (!EmitType(out, ptr->type)) {
return false;
}
- if (ptr->access != ast::Access::kInvalid) {
+ if (ptr->access != ast::Access::kUndefined) {
out << ", ";
if (!EmitAccess(out, ptr->access)) {
return false;
@@ -656,9 +656,9 @@
out << "var";
auto address_space = var->declared_address_space;
auto ac = var->declared_access;
- if (address_space != ast::AddressSpace::kNone || ac != ast::Access::kInvalid) {
+ if (address_space != ast::AddressSpace::kNone || ac != ast::Access::kUndefined) {
out << "<" << address_space;
- if (ac != ast::Access::kInvalid) {
+ if (ac != ast::Access::kUndefined) {
out << ", ";
if (!EmitAccess(out, ac)) {
return false;
@@ -769,7 +769,7 @@
},
[&](const ast::InterpolateAttribute* interpolate) {
out << "interpolate(" << interpolate->type;
- if (interpolate->sampling != ast::InterpolationSampling::kInvalid) {
+ if (interpolate->sampling != ast::InterpolationSampling::kUndefined) {
out << ", " << interpolate->sampling;
}
out << ")";