clang-format
Change-Id: Ibb0a7f4612ee5bf12f6c23a2529711808453685c Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132880 Kokoro: Ben Clayton <bclayton@chromium.org> Reviewed-by: James Price <jrprice@google.com> Commit-Queue: Ben Clayton <bclayton@chromium.org>
This commit is contained in:
parent
14ed533565
commit
c9dd75a0e9
|
@ -313,8 +313,8 @@ struct BufferAccess {
|
||||||
|
|
||||||
/// Store describes a single storage or uniform buffer write
|
/// Store describes a single storage or uniform buffer write
|
||||||
struct Store {
|
struct Store {
|
||||||
const AssignmentStatement* assignment; // The AST assignment statement
|
const AssignmentStatement* assignment; // The AST assignment statement
|
||||||
BufferAccess target; // The target for the write
|
BufferAccess target; // The target for the write
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
|
@ -101,20 +101,19 @@ Transform::ApplyResult SubstituteOverride::Apply(const Program* src,
|
||||||
// Ensure that objects that are indexed with an override-expression are materialized.
|
// Ensure that objects that are indexed with an override-expression are materialized.
|
||||||
// If the object is not materialized, and the 'override' variable is turned to a 'const', the
|
// If the object is not materialized, and the 'override' variable is turned to a 'const', the
|
||||||
// resulting type of the index may change. See: crbug.com/tint/1697.
|
// resulting type of the index may change. See: crbug.com/tint/1697.
|
||||||
ctx.ReplaceAll(
|
ctx.ReplaceAll([&](const IndexAccessorExpression* expr) -> const IndexAccessorExpression* {
|
||||||
[&](const IndexAccessorExpression* expr) -> const IndexAccessorExpression* {
|
if (auto* sem = src->Sem().Get(expr)) {
|
||||||
if (auto* sem = src->Sem().Get(expr)) {
|
if (auto* access = sem->UnwrapMaterialize()->As<sem::IndexAccessorExpression>()) {
|
||||||
if (auto* access = sem->UnwrapMaterialize()->As<sem::IndexAccessorExpression>()) {
|
if (access->Object()->UnwrapMaterialize()->Type()->HoldsAbstract() &&
|
||||||
if (access->Object()->UnwrapMaterialize()->Type()->HoldsAbstract() &&
|
access->Index()->Stage() == sem::EvaluationStage::kOverride) {
|
||||||
access->Index()->Stage() == sem::EvaluationStage::kOverride) {
|
auto* obj = b.Call(builtin::str(builtin::Function::kTintMaterialize),
|
||||||
auto* obj = b.Call(builtin::str(builtin::Function::kTintMaterialize),
|
ctx.Clone(expr->object));
|
||||||
ctx.Clone(expr->object));
|
return b.IndexAccessor(obj, ctx.Clone(expr->index));
|
||||||
return b.IndexAccessor(obj, ctx.Clone(expr->index));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nullptr;
|
}
|
||||||
});
|
return nullptr;
|
||||||
|
});
|
||||||
|
|
||||||
ctx.Clone();
|
ctx.Clone();
|
||||||
return Program(std::move(b));
|
return Program(std::move(b));
|
||||||
|
|
|
@ -154,16 +154,15 @@ Transform::ApplyResult TruncateInterstageVariables::Apply(const Program* src,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Replace return statements with new truncated shader IO struct
|
// Replace return statements with new truncated shader IO struct
|
||||||
ctx.ReplaceAll(
|
ctx.ReplaceAll([&](const ReturnStatement* return_statement) -> const ReturnStatement* {
|
||||||
[&](const ReturnStatement* return_statement) -> const ReturnStatement* {
|
auto* return_sem = sem.Get(return_statement);
|
||||||
auto* return_sem = sem.Get(return_statement);
|
if (auto mapping_fn_sym =
|
||||||
if (auto mapping_fn_sym =
|
entry_point_functions_to_truncate_functions.Find(return_sem->Function())) {
|
||||||
entry_point_functions_to_truncate_functions.Find(return_sem->Function())) {
|
return b.Return(return_statement->source,
|
||||||
return b.Return(return_statement->source,
|
b.Call(*mapping_fn_sym, ctx.Clone(return_statement->value)));
|
||||||
b.Call(*mapping_fn_sym, ctx.Clone(return_statement->value)));
|
}
|
||||||
}
|
return nullptr;
|
||||||
return nullptr;
|
});
|
||||||
});
|
|
||||||
|
|
||||||
// Remove IO attributes from old shader IO struct which is not used as entry point output
|
// Remove IO attributes from old shader IO struct which is not used as entry point output
|
||||||
// anymore.
|
// anymore.
|
||||||
|
|
Loading…
Reference in New Issue