Emit deprecation warnings for @stage.
This PR enables the deprecation warnings for the @stage builtin. Bug: tint:1503 Change-Id: I4a560f451a9ad56bc712f6a04c18eba6ae67ab64 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93121 Reviewed-by: Ben Clayton <bclayton@google.com> Auto-Submit: Dan Sinclair <dsinclair@chromium.org> Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
parent
125ce575b9
commit
0fa572ff05
|
@ -1,5 +1,16 @@
|
|||
# Tint changes during Origin Trial
|
||||
|
||||
## Changes for M105
|
||||
|
||||
### Deprecated Features
|
||||
|
||||
* The `@stage` attribute has been deprecated. The short forms should be used
|
||||
instead (`@vertex`, `@fragment`, or `@compute`). [tint:1503](crbug.com/tint/1503)
|
||||
|
||||
## Changes for M104
|
||||
|
||||
* Parsing of `@compute`, `@fragment` and `@vertex` added.
|
||||
|
||||
## Changes for M103
|
||||
|
||||
### New features
|
||||
|
|
|
@ -3251,6 +3251,7 @@ Maybe<const ast::Attribute*> ParserImpl::attribute() {
|
|||
});
|
||||
}
|
||||
|
||||
// TODO(crbug.com/tint/1503): Remove when deprecation period is over.
|
||||
if (t == kStageAttribute) {
|
||||
return expect_paren_block("stage attribute", [&]() -> Result {
|
||||
auto stage = expect_pipeline_stage();
|
||||
|
@ -3258,11 +3259,7 @@ Maybe<const ast::Attribute*> ParserImpl::attribute() {
|
|||
return Failure::kErrored;
|
||||
}
|
||||
|
||||
// TODO(crbug.com/tint/1503): Enable this once all the Dawn and CTS
|
||||
// tests are updated to use the new format so we can avoid spamming
|
||||
// the log files.
|
||||
if ((false)) {
|
||||
std::string warning = "stage should use @";
|
||||
std::string warning = "remove stage and use @";
|
||||
switch (stage.value) {
|
||||
case ast::PipelineStage::kVertex:
|
||||
warning += "vertex";
|
||||
|
@ -3277,7 +3274,7 @@ Maybe<const ast::Attribute*> ParserImpl::attribute() {
|
|||
break;
|
||||
}
|
||||
deprecated(t.source(), warning);
|
||||
}
|
||||
|
||||
return create<ast::StageAttribute>(t.source(), stage.value);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -316,8 +316,13 @@ TEST_F(ParserImplErrorTest, FunctionDeclStageMissingLParen) {
|
|||
}
|
||||
|
||||
TEST_F(ParserImplErrorTest, FunctionDeclStageMissingRParen) {
|
||||
EXPECT("@stage(vertex fn f() {}",
|
||||
R"(test.wgsl:1:15 error: expected ')' for stage attribute
|
||||
EXPECT(
|
||||
"@stage(vertex fn f() {}",
|
||||
R"(test.wgsl:1:2 warning: use of deprecated language feature: remove stage and use @vertex
|
||||
@stage(vertex fn f() {}
|
||||
^^^^^
|
||||
|
||||
test.wgsl:1:15 error: expected ')' for stage attribute
|
||||
@stage(vertex fn f() {}
|
||||
^^
|
||||
)");
|
||||
|
|
|
@ -263,7 +263,8 @@ TEST_F(ParserImplTest, Attribute_Stage_MissingRightParen) {
|
|||
EXPECT_TRUE(attr.errored);
|
||||
EXPECT_EQ(attr.value, nullptr);
|
||||
EXPECT_TRUE(p->has_error());
|
||||
EXPECT_EQ(p->error(), "1:14: expected ')' for stage attribute");
|
||||
EXPECT_EQ(p->error(), R"(1:1: use of deprecated language feature: remove stage and use @compute
|
||||
1:14: expected ')' for stage attribute)");
|
||||
}
|
||||
|
||||
TEST_F(ParserImplTest, Attribute_Compute) {
|
||||
|
|
Loading…
Reference in New Issue