Move ast/texel_format to type/texel_format.

This CL moves the texel_format code from ast to type to remove the
dependency on ast from type.

Change-Id: Ie075b2315360dc782284a7b4b55a817a9de31d78
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117606
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
dan sinclair
2023-01-21 23:51:25 +00:00
committed by Dawn LUCI CQ
parent 61c16eb448
commit 57c0bbc2a5
59 changed files with 529 additions and 527 deletions

View File

@@ -946,7 +946,7 @@ Transform::ApplyResult BuiltinPolyfill::Apply(const Program* src,
auto& sig = builtin->Signature();
auto* tex = sig.Parameter(sem::ParameterUsage::kTexture);
if (auto* stex = tex->Type()->As<type::StorageTexture>()) {
if (stex->texel_format() == ast::TexelFormat::kBgra8Unorm) {
if (stex->texel_format() == type::TexelFormat::kBgra8Unorm) {
size_t value_idx = static_cast<size_t>(
sig.IndexOf(sem::ParameterUsage::kValue));
ctx.Replace(expr, [&ctx, expr, value_idx] {
@@ -1026,9 +1026,9 @@ Transform::ApplyResult BuiltinPolyfill::Apply(const Program* src,
}
},
[&](const ast::StorageTexture* tex) {
if (polyfill.bgra8unorm && tex->format == ast::TexelFormat::kBgra8Unorm) {
if (polyfill.bgra8unorm && tex->format == type::TexelFormat::kBgra8Unorm) {
ctx.Replace(tex, [&ctx, tex] {
return ctx.dst->ty.storage_texture(tex->dim, ast::TexelFormat::kRgba8Unorm,
return ctx.dst->ty.storage_texture(tex->dim, type::TexelFormat::kRgba8Unorm,
tex->access);
});
made_changes = true;