[spirv-reader] Remove support for NumWorkgroups builtin variable

It was removed from WGSL MVP
https://github.com/gpuweb/gpuweb/issues/920

Bug: tint:3
Change-Id: I94a584feec88dda7e310ee5d7fa01e93e26cd31d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25526
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
This commit is contained in:
David Neto 2020-08-05 21:16:59 +00:00
parent b77399cbad
commit 6eb2a85adf
10 changed files with 6 additions and 26 deletions

View File

@ -47,10 +47,6 @@ std::ostream& operator<<(std::ostream& out, Builtin builtin) {
out << "frag_depth"; out << "frag_depth";
break; break;
} }
case Builtin::kNumWorkgroups: {
out << "num_workgroups";
break;
}
case Builtin::kWorkgroupSize: { case Builtin::kWorkgroupSize: {
out << "workgroup_size"; out << "workgroup_size";
break; break;

View File

@ -29,7 +29,6 @@ enum class Builtin {
kFrontFacing, kFrontFacing,
kFragCoord, kFragCoord,
kFragDepth, kFragDepth,
kNumWorkgroups,
kWorkgroupSize, kWorkgroupSize,
kLocalInvocationId, kLocalInvocationId,
kLocalInvocationIdx, kLocalInvocationIdx,

View File

@ -80,8 +80,6 @@ ast::Builtin EnumConverter::ToBuiltin(SpvBuiltIn b) {
return ast::Builtin::kFragCoord; return ast::Builtin::kFragCoord;
case SpvBuiltInFragDepth: case SpvBuiltInFragDepth:
return ast::Builtin::kFragDepth; return ast::Builtin::kFragDepth;
case SpvBuiltInNumWorkgroups:
return ast::Builtin::kNumWorkgroups;
case SpvBuiltInWorkgroupSize: case SpvBuiltInWorkgroupSize:
return ast::Builtin::kWorkgroupSize; return ast::Builtin::kWorkgroupSize;
case SpvBuiltInLocalInvocationId: case SpvBuiltInLocalInvocationId:

View File

@ -215,8 +215,6 @@ INSTANTIATE_TEST_SUITE_P(
BuiltinCase{SpvBuiltInFrontFacing, true, ast::Builtin::kFrontFacing}, BuiltinCase{SpvBuiltInFrontFacing, true, ast::Builtin::kFrontFacing},
BuiltinCase{SpvBuiltInFragCoord, true, ast::Builtin::kFragCoord}, BuiltinCase{SpvBuiltInFragCoord, true, ast::Builtin::kFragCoord},
BuiltinCase{SpvBuiltInFragDepth, true, ast::Builtin::kFragDepth}, BuiltinCase{SpvBuiltInFragDepth, true, ast::Builtin::kFragDepth},
BuiltinCase{SpvBuiltInNumWorkgroups, true,
ast::Builtin::kNumWorkgroups},
BuiltinCase{SpvBuiltInWorkgroupSize, true, BuiltinCase{SpvBuiltInWorkgroupSize, true,
ast::Builtin::kWorkgroupSize}, ast::Builtin::kWorkgroupSize},
BuiltinCase{SpvBuiltInLocalInvocationId, true, BuiltinCase{SpvBuiltInLocalInvocationId, true,
@ -226,11 +224,12 @@ INSTANTIATE_TEST_SUITE_P(
BuiltinCase{SpvBuiltInGlobalInvocationId, true, BuiltinCase{SpvBuiltInGlobalInvocationId, true,
ast::Builtin::kGlobalInvocationId})); ast::Builtin::kGlobalInvocationId}));
INSTANTIATE_TEST_SUITE_P(EnumConverterBad, INSTANTIATE_TEST_SUITE_P(
SpvBuiltinTest, EnumConverterBad,
testing::Values(BuiltinCase{ SpvBuiltinTest,
static_cast<SpvBuiltIn>(9999), false, testing::Values(
ast::Builtin::kNone})); BuiltinCase{static_cast<SpvBuiltIn>(9999), false, ast::Builtin::kNone},
BuiltinCase{SpvBuiltInNumWorkgroups, false, ast::Builtin::kNone}));
} // namespace } // namespace
} // namespace spirv } // namespace spirv

View File

@ -86,9 +86,6 @@ ast::Builtin ident_to_builtin(const std::string& str) {
if (str == "frag_depth") { if (str == "frag_depth") {
return ast::Builtin::kFragDepth; return ast::Builtin::kFragDepth;
} }
if (str == "num_workgroups") {
return ast::Builtin::kNumWorkgroups;
}
if (str == "workgroup_size") { if (str == "workgroup_size") {
return ast::Builtin::kWorkgroupSize; return ast::Builtin::kWorkgroupSize;
} }

View File

@ -101,7 +101,6 @@ INSTANTIATE_TEST_SUITE_P(
BuiltinData{"front_facing", ast::Builtin::kFrontFacing}, BuiltinData{"front_facing", ast::Builtin::kFrontFacing},
BuiltinData{"frag_coord", ast::Builtin::kFragCoord}, BuiltinData{"frag_coord", ast::Builtin::kFragCoord},
BuiltinData{"frag_depth", ast::Builtin::kFragDepth}, BuiltinData{"frag_depth", ast::Builtin::kFragDepth},
BuiltinData{"num_workgroups", ast::Builtin::kNumWorkgroups},
BuiltinData{"workgroup_size", ast::Builtin::kWorkgroupSize}, BuiltinData{"workgroup_size", ast::Builtin::kWorkgroupSize},
BuiltinData{"local_invocation_id", ast::Builtin::kLocalInvocationId}, BuiltinData{"local_invocation_id", ast::Builtin::kLocalInvocationId},
BuiltinData{"local_invocation_idx", ast::Builtin::kLocalInvocationIdx}, BuiltinData{"local_invocation_idx", ast::Builtin::kLocalInvocationIdx},

View File

@ -1258,10 +1258,6 @@ std::string GeneratorImpl::builtin_to_attribute(ast::Builtin builtin) const {
return "position"; return "position";
case ast::Builtin::kFragDepth: case ast::Builtin::kFragDepth:
return "depth(any)"; return "depth(any)";
// TODO(dsinclair): Ignore for now, I believe it will be removed from WGSL
// https://github.com/gpuweb/gpuweb/issues/920
case ast::Builtin::kNumWorkgroups:
return "";
// TODO(dsinclair): Ignore for now. This has been removed as a builtin // TODO(dsinclair): Ignore for now. This has been removed as a builtin
// in the spec. Need to update Tint to match. // in the spec. Need to update Tint to match.
// https://github.com/gpuweb/gpuweb/pull/824 // https://github.com/gpuweb/gpuweb/pull/824

View File

@ -116,7 +116,6 @@ INSTANTIATE_TEST_SUITE_P(
MslBuiltinData{ast::Builtin::kFrontFacing, "front_facing"}, MslBuiltinData{ast::Builtin::kFrontFacing, "front_facing"},
MslBuiltinData{ast::Builtin::kFragCoord, "position"}, MslBuiltinData{ast::Builtin::kFragCoord, "position"},
MslBuiltinData{ast::Builtin::kFragDepth, "depth(any)"}, MslBuiltinData{ast::Builtin::kFragDepth, "depth(any)"},
MslBuiltinData{ast::Builtin::kNumWorkgroups, ""},
MslBuiltinData{ast::Builtin::kWorkgroupSize, ""}, MslBuiltinData{ast::Builtin::kWorkgroupSize, ""},
MslBuiltinData{ast::Builtin::kLocalInvocationId, MslBuiltinData{ast::Builtin::kLocalInvocationId,
"thread_position_in_threadgroup"}, "thread_position_in_threadgroup"},

View File

@ -2086,8 +2086,6 @@ SpvBuiltIn Builder::ConvertBuiltin(ast::Builtin builtin) const {
return SpvBuiltInFragCoord; return SpvBuiltInFragCoord;
case ast::Builtin::kFragDepth: case ast::Builtin::kFragDepth:
return SpvBuiltInFragDepth; return SpvBuiltInFragDepth;
case ast::Builtin::kNumWorkgroups:
return SpvBuiltInNumWorkgroups;
case ast::Builtin::kWorkgroupSize: case ast::Builtin::kWorkgroupSize:
return SpvBuiltInWorkgroupSize; return SpvBuiltInWorkgroupSize;
case ast::Builtin::kLocalInvocationId: case ast::Builtin::kLocalInvocationId:

View File

@ -387,7 +387,6 @@ INSTANTIATE_TEST_SUITE_P(
BuiltinData{ast::Builtin::kFrontFacing, SpvBuiltInFrontFacing}, BuiltinData{ast::Builtin::kFrontFacing, SpvBuiltInFrontFacing},
BuiltinData{ast::Builtin::kFragCoord, SpvBuiltInFragCoord}, BuiltinData{ast::Builtin::kFragCoord, SpvBuiltInFragCoord},
BuiltinData{ast::Builtin::kFragDepth, SpvBuiltInFragDepth}, BuiltinData{ast::Builtin::kFragDepth, SpvBuiltInFragDepth},
BuiltinData{ast::Builtin::kNumWorkgroups, SpvBuiltInNumWorkgroups},
BuiltinData{ast::Builtin::kWorkgroupSize, SpvBuiltInWorkgroupSize}, BuiltinData{ast::Builtin::kWorkgroupSize, SpvBuiltInWorkgroupSize},
BuiltinData{ast::Builtin::kLocalInvocationId, BuiltinData{ast::Builtin::kLocalInvocationId,
SpvBuiltInLocalInvocationId}, SpvBuiltInLocalInvocationId},