From c2972cfa6002cc52f327e3f55179e5aa439bc787 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Tue, 26 Jan 2021 20:21:31 +0000 Subject: [PATCH] Remove support for the old _idx builtins. This CL removes the old _idx variants of builtins in favour of the _index versions. Change-Id: I1678b5fae63c9d4f7f63feabf7410a58505d397a Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/38825 Auto-Submit: dan sinclair Reviewed-by: Ben Clayton Commit-Queue: dan sinclair --- src/reader/wgsl/parser_impl.cc | 6 +++--- src/reader/wgsl/parser_impl_variable_decoration_test.cc | 4 ---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/reader/wgsl/parser_impl.cc b/src/reader/wgsl/parser_impl.cc index 649589bf17..dcf8794b37 100644 --- a/src/reader/wgsl/parser_impl.cc +++ b/src/reader/wgsl/parser_impl.cc @@ -103,10 +103,10 @@ ast::Builtin ident_to_builtin(const std::string& str) { if (str == "position") { return ast::Builtin::kPosition; } - if (str == "vertex_idx" || str == "vertex_index") { + if (str == "vertex_index") { return ast::Builtin::kVertexIndex; } - if (str == "instance_idx" || str == "instance_index") { + if (str == "instance_index") { return ast::Builtin::kInstanceIndex; } if (str == "front_facing") { @@ -121,7 +121,7 @@ ast::Builtin ident_to_builtin(const std::string& str) { if (str == "local_invocation_id") { return ast::Builtin::kLocalInvocationId; } - if (str == "local_invocation_idx" || str == "local_invocation_index") { + if (str == "local_invocation_index") { return ast::Builtin::kLocalInvocationIndex; } if (str == "global_invocation_id") { diff --git a/src/reader/wgsl/parser_impl_variable_decoration_test.cc b/src/reader/wgsl/parser_impl_variable_decoration_test.cc index 128ec8aabe..db50003947 100644 --- a/src/reader/wgsl/parser_impl_variable_decoration_test.cc +++ b/src/reader/wgsl/parser_impl_variable_decoration_test.cc @@ -113,17 +113,13 @@ INSTANTIATE_TEST_SUITE_P( ParserImplTest, BuiltinTest, testing::Values(BuiltinData{"position", ast::Builtin::kPosition}, - BuiltinData{"vertex_idx", ast::Builtin::kVertexIndex}, BuiltinData{"vertex_index", ast::Builtin::kVertexIndex}, - BuiltinData{"instance_idx", ast::Builtin::kInstanceIndex}, BuiltinData{"instance_index", ast::Builtin::kInstanceIndex}, BuiltinData{"front_facing", ast::Builtin::kFrontFacing}, BuiltinData{"frag_coord", ast::Builtin::kFragCoord}, BuiltinData{"frag_depth", ast::Builtin::kFragDepth}, BuiltinData{"local_invocation_id", ast::Builtin::kLocalInvocationId}, - BuiltinData{"local_invocation_idx", - ast::Builtin::kLocalInvocationIndex}, BuiltinData{"local_invocation_index", ast::Builtin::kLocalInvocationIndex}, BuiltinData{"global_invocation_id",