Tint: add chromium_internal_input_attachments extension to wgsl.def
Bug: 341117913
Change-Id: I1a5413e9db834600446b6ec5d79e706019b40bab
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/189400
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
diff --git a/src/tint/cmd/fuzz/wgsl/dictionary.txt b/src/tint/cmd/fuzz/wgsl/dictionary.txt
index a8a1694..fde58b9 100644
--- a/src/tint/cmd/fuzz/wgsl/dictionary.txt
+++ b/src/tint/cmd/fuzz/wgsl/dictionary.txt
@@ -159,6 +159,7 @@
"chromium_experimental_subgroups"
"chromium_internal_dual_source_blending"
"chromium_internal_graphite"
+"chromium_internal_input_attachments"
"chromium_internal_relaxed_uniform_layout"
"chromium_testing_experimental"
"chromium_testing_shipped"
diff --git a/src/tint/lang/wgsl/extension.cc b/src/tint/lang/wgsl/extension.cc
index 1240173..e6790ec 100644
--- a/src/tint/lang/wgsl/extension.cc
+++ b/src/tint/lang/wgsl/extension.cc
@@ -63,6 +63,9 @@
if (str == "chromium_internal_graphite") {
return Extension::kChromiumInternalGraphite;
}
+ if (str == "chromium_internal_input_attachments") {
+ return Extension::kChromiumInternalInputAttachments;
+ }
if (str == "chromium_internal_relaxed_uniform_layout") {
return Extension::kChromiumInternalRelaxedUniformLayout;
}
@@ -90,6 +93,8 @@
return "chromium_internal_dual_source_blending";
case Extension::kChromiumInternalGraphite:
return "chromium_internal_graphite";
+ case Extension::kChromiumInternalInputAttachments:
+ return "chromium_internal_input_attachments";
case Extension::kChromiumInternalRelaxedUniformLayout:
return "chromium_internal_relaxed_uniform_layout";
case Extension::kF16:
diff --git a/src/tint/lang/wgsl/extension.h b/src/tint/lang/wgsl/extension.h
index 3eccedf..ed1ee13 100644
--- a/src/tint/lang/wgsl/extension.h
+++ b/src/tint/lang/wgsl/extension.h
@@ -53,6 +53,7 @@
kChromiumExperimentalSubgroups,
kChromiumInternalDualSourceBlending,
kChromiumInternalGraphite,
+ kChromiumInternalInputAttachments,
kChromiumInternalRelaxedUniformLayout,
kF16,
};
@@ -82,6 +83,7 @@
"chromium_experimental_subgroups",
"chromium_internal_dual_source_blending",
"chromium_internal_graphite",
+ "chromium_internal_input_attachments",
"chromium_internal_relaxed_uniform_layout",
"f16",
};
@@ -95,6 +97,7 @@
Extension::kChromiumExperimentalSubgroups,
Extension::kChromiumInternalDualSourceBlending,
Extension::kChromiumInternalGraphite,
+ Extension::kChromiumInternalInputAttachments,
Extension::kChromiumInternalRelaxedUniformLayout,
Extension::kF16,
};
diff --git a/src/tint/lang/wgsl/extension_bench.cc b/src/tint/lang/wgsl/extension_bench.cc
index c2128d3..7e209ff 100644
--- a/src/tint/lang/wgsl/extension_bench.cc
+++ b/src/tint/lang/wgsl/extension_bench.cc
@@ -94,20 +94,27 @@
"chromium_intenalNNgraphite",
"chromiuminternal_gvaphite",
"chromium_internal_grphitQQ",
- "chromirm_intenal_rfflaxed_unifrm_layout",
- "chromium_internal_jelaxed_uniform_layout",
- "chromium_interna_relNNxed_uwwiform_lay82t",
+ "chromirm_ffnternalinpt_attachments",
+ "chromium_internal_input_attachmenjs",
+ "chwwomiu2_interNNal_inpu_att8chments",
+ "chromium_internal_input_attachments",
+ "chromium_internalinput_attachments",
+ "crrromium_internal_input_attachments",
+ "Ghromium_internal_input_attachments",
+ "chromium_internalFFrelaxed_uniform_layout",
+ "chromEum_internal_relaxed_unifrmlyout",
+ "chromium_internalrrrelaxd_uniform_layout",
"chromium_internal_relaxed_uniform_layout",
- "chromium_internal_relaxed_uniform_layut",
- "chromium_internal_relaxed_rrniform_layout",
- "chromium_internal_relaxedGuniform_layout",
- "FF16",
- "",
- "rr1",
+ "chromiuminternal_relaxed_uniform_layut",
+ "cXroDium_internal_rJJlaed_uniform_layout",
+ "chromium_int8nal_relaed_uniform_layut",
+ "k",
+ "16",
+ "J1",
"f16",
- "1",
- "DJ1",
- "",
+ "c16",
+ "fO6",
+ "_KKttvv",
};
for (auto _ : state) {
for (auto* str : kStrings) {
diff --git a/src/tint/lang/wgsl/extension_test.cc b/src/tint/lang/wgsl/extension_test.cc
index 11a75b0..9e6c182 100644
--- a/src/tint/lang/wgsl/extension_test.cc
+++ b/src/tint/lang/wgsl/extension_test.cc
@@ -64,6 +64,7 @@
{"chromium_experimental_subgroups", Extension::kChromiumExperimentalSubgroups},
{"chromium_internal_dual_source_blending", Extension::kChromiumInternalDualSourceBlending},
{"chromium_internal_graphite", Extension::kChromiumInternalGraphite},
+ {"chromium_internal_input_attachments", Extension::kChromiumInternalInputAttachments},
{"chromium_internal_relaxed_uniform_layout", Extension::kChromiumInternalRelaxedUniformLayout},
{"f16", Extension::kF16},
};
@@ -90,12 +91,15 @@
{"chromi44m_internal_graphite", Extension::kUndefined},
{"chromSSuVV_internal_graphite", Extension::kUndefined},
{"cRromium_nternR22_graphite", Extension::kUndefined},
- {"chromium_int9rnal_relaxed_Fnifor_layout", Extension::kUndefined},
- {"chrmium_internal_relaxed_uniform_layout", Extension::kUndefined},
- {"VRhHomium_internal_relaxd_uniform_OOayout", Extension::kUndefined},
- {"y1", Extension::kUndefined},
- {"l77rrn6", Extension::kUndefined},
- {"4016", Extension::kUndefined},
+ {"chromium_int9rnaF_inpu_attachments", Extension::kUndefined},
+ {"chrmium_internal_input_attachments", Extension::kUndefined},
+ {"cOOromium_internVlHinput_ttachRRents", Extension::kUndefined},
+ {"chromium_internl_relaxyd_uniform_layout", Extension::kUndefined},
+ {"chromnnum_internrr77_Gelaxell_uniform_layout", Extension::kUndefined},
+ {"chromium_intern4l_relaxe00_uniform_layout", Extension::kUndefined},
+ {"5", Extension::kUndefined},
+ {"u16", Extension::kUndefined},
+ {"f", Extension::kUndefined},
};
using ExtensionParseTest = testing::TestWithParam<Case>;
diff --git a/src/tint/lang/wgsl/reader/parser/enable_directive_test.cc b/src/tint/lang/wgsl/reader/parser/enable_directive_test.cc
index adb1d1c..34d0d00 100644
--- a/src/tint/lang/wgsl/reader/parser/enable_directive_test.cc
+++ b/src/tint/lang/wgsl/reader/parser/enable_directive_test.cc
@@ -205,7 +205,7 @@
// Error when unknown extension found
EXPECT_TRUE(p->has_error());
EXPECT_EQ(p->error(), R"(1:8: expected extension
-Possible values: 'chromium_disable_uniformity_analysis', 'chromium_experimental_framebuffer_fetch', 'chromium_experimental_pixel_local', 'chromium_experimental_push_constant', 'chromium_experimental_subgroups', 'chromium_internal_dual_source_blending', 'chromium_internal_graphite', 'chromium_internal_relaxed_uniform_layout', 'f16')");
+Possible values: 'chromium_disable_uniformity_analysis', 'chromium_experimental_framebuffer_fetch', 'chromium_experimental_pixel_local', 'chromium_experimental_push_constant', 'chromium_experimental_subgroups', 'chromium_internal_dual_source_blending', 'chromium_internal_graphite', 'chromium_internal_input_attachments', 'chromium_internal_relaxed_uniform_layout', 'f16')");
auto program = p->program();
auto& ast = program.AST();
EXPECT_EQ(ast.Enables().Length(), 0u);
diff --git a/src/tint/lang/wgsl/wgsl.def b/src/tint/lang/wgsl/wgsl.def
index acf3735..a16ae7f 100644
--- a/src/tint/lang/wgsl/wgsl.def
+++ b/src/tint/lang/wgsl/wgsl.def
@@ -78,6 +78,9 @@
chromium_experimental_subgroups
// A Chromium-specific extension that enables features for graphite
chromium_internal_graphite
+ // A Chromium-specific extension that enables features for input
+ // attachments
+ chromium_internal_input_attachments
// A Chromium-specific extension that relaxes memory layout requirements for uniform storage.
chromium_internal_relaxed_uniform_layout
// A Chromium-specific extension that enables dual source blending.