mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-12 14:46:08 +00:00
tint/transform: Fix index 0 accessing in DecomposeMemoryAccess
This patch fix a bug in DecomposeMemoryAccess, allowing access index 0 of a member in uniform and storage buffer being recognized as constant index. Bug: tint:1652 Change-Id: Ia428de17c860bdafe87c3af9e46426c74fe8fd68 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/99480 Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com> Reviewed-by: Ben Clayton <bclayton@google.com> Auto-Submit: Zhaoming Jiang <zhaoming.jiang@intel.com> Commit-Queue: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
dce63f5717
commit
ff1330240b
@@ -328,7 +328,7 @@ struct DecomposeMemoryAccess::State {
|
||||
/// @returns an Offset for the given ast::Expression
|
||||
const Offset* ToOffset(const ast::Expression* expr) {
|
||||
if (auto* lit = expr->As<ast::IntLiteralExpression>()) {
|
||||
if (lit->value > 0) {
|
||||
if (lit->value >= 0) {
|
||||
return offsets_.Create<OffsetLiteral>(static_cast<uint32_t>(lit->value));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user