mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-10 05:57:51 +00:00
Replace VariableDecoration::(Is|As)Location with Castable
Change-Id: I3096045fc093f3782401ce8623a18e0bca49b22c Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34309 Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
@@ -200,18 +200,16 @@ void VertexPullingTransform::ConvertVertexInputVariablesToPrivate() {
|
||||
}
|
||||
|
||||
for (auto* d : v->AsDecorated()->decorations()) {
|
||||
if (!d->IsLocation()) {
|
||||
continue;
|
||||
if (auto* l = d->As<ast::LocationDecoration>()) {
|
||||
uint32_t location = l->value();
|
||||
// This is where the replacement happens. Expressions use identifier
|
||||
// strings instead of pointers, so we don't need to update any other
|
||||
// place in the AST.
|
||||
v = create<ast::Variable>(v->name(), ast::StorageClass::kPrivate,
|
||||
v->type());
|
||||
location_to_var_[location] = v;
|
||||
break;
|
||||
}
|
||||
|
||||
uint32_t location = d->AsLocation()->value();
|
||||
// This is where the replacement happens. Expressions use identifier
|
||||
// strings instead of pointers, so we don't need to update any other place
|
||||
// in the AST.
|
||||
v = create<ast::Variable>(v->name(), ast::StorageClass::kPrivate,
|
||||
v->type());
|
||||
location_to_var_[location] = v;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user