writer/wgsl: Remove builtin unit test

This test is invalid for multiple reasons (wrong types, wrong stages,
global variable instead of a parameter). The shader IO E2E tests give
better coverage for this anyway, so just delete the unit test.

Change-Id: I1627addf1e407e473e33043341d742958ceebca5
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/55861
Auto-Submit: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
James Price 2021-06-24 08:20:46 +00:00 committed by Tint LUCI CQ
parent 57a737ba3b
commit 9cae45e6ca
1 changed files with 0 additions and 42 deletions

View File

@ -34,48 +34,6 @@ TEST_F(WgslGeneratorImplTest, Generate) {
)"); )");
} }
struct WgslBuiltinData {
ast::Builtin builtin;
const char* attribute_name;
};
inline std::ostream& operator<<(std::ostream& out, WgslBuiltinData data) {
out << data.builtin;
return out;
}
using WgslBuiltinConversionTest = TestParamHelper<WgslBuiltinData>;
TEST_P(WgslBuiltinConversionTest, Emit) {
auto params = GetParam();
auto* var = Global("a", ty.f32(), ast::StorageClass::kPrivate, nullptr,
ast::DecorationList{
Builtin(params.builtin),
});
GeneratorImpl& gen = Build();
gen.EmitDecorations(var->decorations());
EXPECT_EQ(gen.result(),
"[[builtin(" + std::string(params.attribute_name) + ")]]");
}
INSTANTIATE_TEST_SUITE_P(
WgslGeneratorImplTest,
WgslBuiltinConversionTest,
testing::Values(
WgslBuiltinData{ast::Builtin::kPosition, "position"},
WgslBuiltinData{ast::Builtin::kVertexIndex, "vertex_index"},
WgslBuiltinData{ast::Builtin::kInstanceIndex, "instance_index"},
WgslBuiltinData{ast::Builtin::kFrontFacing, "front_facing"},
WgslBuiltinData{ast::Builtin::kFragDepth, "frag_depth"},
WgslBuiltinData{ast::Builtin::kLocalInvocationId,
"local_invocation_id"},
WgslBuiltinData{ast::Builtin::kLocalInvocationIndex,
"local_invocation_index"},
WgslBuiltinData{ast::Builtin::kGlobalInvocationId,
"global_invocation_id"},
WgslBuiltinData{ast::Builtin::kWorkgroupId, "workgroup_id"},
WgslBuiltinData{ast::Builtin::kSampleIndex, "sample_index"}));
} // namespace } // namespace
} // namespace wgsl } // namespace wgsl
} // namespace writer } // namespace writer