mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 18:59:21 +00:00
tint/resolver: Allow array sizes to be unnamed override-expressions
I got the rules around this wrong. This should be allowed, but the array types cannot compare equal if they are unnamed override-expressions. Fixed tint:1737 Change-Id: I83dc49703eed015e9c183e804474886da5dad7b9 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/107685 Reviewed-by: James Price <jrprice@google.com> Commit-Queue: Ben Clayton <bclayton@google.com> Auto-Submit: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
cc85ed6dd1
commit
22c4850b06
@@ -114,10 +114,14 @@ const ast::Type* Transform::CreateASTTypeFor(CloneContext& ctx, const sem::Type*
|
||||
if (a->IsRuntimeSized()) {
|
||||
return ctx.dst->ty.array(el, nullptr, std::move(attrs));
|
||||
}
|
||||
if (auto* override = std::get_if<sem::OverrideArrayCount>(&a->Count())) {
|
||||
if (auto* override = std::get_if<sem::NamedOverrideArrayCount>(&a->Count())) {
|
||||
auto* count = ctx.Clone(override->variable->Declaration());
|
||||
return ctx.dst->ty.array(el, count, std::move(attrs));
|
||||
}
|
||||
if (auto* override = std::get_if<sem::UnnamedOverrideArrayCount>(&a->Count())) {
|
||||
auto* count = ctx.Clone(override->expr->Declaration());
|
||||
return ctx.dst->ty.array(el, count, std::move(attrs));
|
||||
}
|
||||
if (auto count = a->ConstantCount()) {
|
||||
return ctx.dst->ty.array(el, u32(count.value()), std::move(attrs));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user