[spirv-writer] Don't emit abstract accessor source

When traverseing an accessor expression, stop as soon as we hit a
source object that has a constant value. This prevents us from trying
to emit expressions that have abstract types and no materialization
nodes.

Bug: chromium:1442551
Change-Id: I8296ae58e63624e647052cdf966dbff15630a4d8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132040
Auto-Submit: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
James Price
2023-05-09 10:57:21 +00:00
committed by Dawn LUCI CQ
parent f91b77dd6d
commit e162a1adee
8 changed files with 84 additions and 0 deletions

View File

@@ -1034,6 +1034,11 @@ uint32_t Builder::GenerateAccessorExpression(const ast::AccessorExpression* expr
} else {
break;
}
// Stop traversing if we've hit a constant source expression.
if (builder_.Sem().GetVal(source)->ConstantValue()) {
break;
}
}
AccessorInfo info;