validation: fix error msg: textureSample*() offset must be a const_expr
Bug: tint:1016 Change-Id: I631ac820f3174ec7ad12e51396b7584df55b27f1 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/59001 Auto-Submit: Sarah Mashayekhi <sarahmashay@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
parent
0c7332b2ba
commit
36b49e8834
|
@ -223,8 +223,7 @@ TEST_P(IntrinsicTextureSamplerValidationTest, GlobalConst) {
|
|||
EXPECT_FALSE(r()->Resolve());
|
||||
std::stringstream err;
|
||||
err << "12:34 error: '" << param.function
|
||||
<< "' offset parameter must be provided as"
|
||||
<< " a literal or const_expr expression";
|
||||
<< "' offset parameter must be a const_expression";
|
||||
EXPECT_EQ(r()->error(), err.str());
|
||||
}
|
||||
|
||||
|
@ -253,8 +252,7 @@ TEST_P(IntrinsicTextureSamplerValidationTest, ScalarConst) {
|
|||
EXPECT_FALSE(r()->Resolve());
|
||||
std::stringstream err;
|
||||
err << "12:34 error: '" << param.function
|
||||
<< "' offset parameter must be provided as"
|
||||
<< " a literal or const_expr expression";
|
||||
<< "' offset parameter must be a const_expression";
|
||||
EXPECT_EQ(r()->error(), err.str());
|
||||
}
|
||||
|
||||
|
|
|
@ -2479,10 +2479,9 @@ bool Resolver::ValidateTextureIntrinsicFunction(
|
|||
if (param->Is<ast::TypeConstructorExpression>()) {
|
||||
auto values = ConstantValueOf(param);
|
||||
if (!values.IsValid()) {
|
||||
AddError("'" + func_name +
|
||||
"' offset parameter must be provided as a literal or "
|
||||
"const_expr expression",
|
||||
param->source());
|
||||
AddError(
|
||||
"'" + func_name + "' offset parameter must be a const_expression",
|
||||
param->source());
|
||||
return false;
|
||||
}
|
||||
if (!values.Type()->Is<sem::Vector>() ||
|
||||
|
@ -2503,10 +2502,9 @@ bool Resolver::ValidateTextureIntrinsicFunction(
|
|||
}
|
||||
}
|
||||
} else {
|
||||
AddError("'" + func_name +
|
||||
"' offset parameter must be provided as a literal or "
|
||||
"const_expr expression",
|
||||
param->source());
|
||||
AddError(
|
||||
"'" + func_name + "' offset parameter must be a const_expression",
|
||||
param->source());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue