tint/resolver: Allow texture 'offset' to be const-expr

This allows the value to be declared in a `const` expression, and to use arithmetic.

Fixed: tint:1636
Change-Id: Ie641a9d4183429c79c91605cd4df78f569be3579
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/105623
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton 2022-10-13 17:06:29 +00:00 committed by Dawn LUCI CQ
parent d5139b4463
commit 559a248233
87 changed files with 256 additions and 130 deletions

View File

@ -260,8 +260,7 @@ TEST_P(BuiltinTextureConstExprArgValidationTest, Immediate) {
// a vector constructor.
bool is_vector = arg_to_replace->Is<ast::CallExpression>();
// Make the expression to be replaced, reachable. This keeps the resolver
// happy.
// Make the expression to be replaced, reachable. This keeps the resolver happy.
WrapInFunction(arg_to_replace);
arg_to_replace = expr(Source{{12, 34}}, *this);
@ -310,13 +309,65 @@ TEST_P(BuiltinTextureConstExprArgValidationTest, GlobalConst) {
auto args = overload.args(this);
auto*& arg_to_replace = (param.position == Position::kFirst) ? args.Front() : args.Back();
// Make the expression to be replaced, reachable. This keeps the resolver
// happy.
// BuildTextureVariable() uses a Literal for scalars, and a CallExpression for
// a vector constructor.
bool is_vector = arg_to_replace->Is<ast::CallExpression>();
// Make the expression to be replaced, reachable. This keeps the resolver happy.
WrapInFunction(arg_to_replace);
arg_to_replace = Expr(Source{{12, 34}}, "G");
// Call the builtin with the constexpr argument replaced
// Call the builtin with the constant-expression argument replaced
Func("func", utils::Empty, ty.void_(),
utils::Vector{
CallStmt(Call(overload.function, args)),
},
utils::Vector{
Stage(ast::PipelineStage::kFragment),
});
if (expr.invalid_index == Constexpr::kValid) {
EXPECT_TRUE(r()->Resolve()) << r()->error();
} else {
EXPECT_FALSE(r()->Resolve());
std::stringstream err;
if (is_vector) {
err << "12:34 error: each component of the " << param.name
<< " argument must be at least " << param.min << " and at most " << param.max
<< ". " << param.name << " component " << expr.invalid_index << " is "
<< std::to_string(expr.values[static_cast<size_t>(expr.invalid_index)]);
} else {
err << "12:34 error: the " << param.name << " argument must be at least " << param.min
<< " and at most " << param.max << ". " << param.name << " is "
<< std::to_string(expr.values[static_cast<size_t>(expr.invalid_index)]);
}
EXPECT_EQ(r()->error(), err.str());
}
}
TEST_P(BuiltinTextureConstExprArgValidationTest, GlobalVar) {
auto& p = GetParam();
auto overload = std::get<0>(p);
auto param = std::get<1>(p);
auto expr = std::get<2>(p);
// Build the global texture and sampler variables
overload.BuildTextureVariable(this);
overload.BuildSamplerVariable(this);
// Build the module-scope var 'G' with the offset value
GlobalVar("G", expr({}, *this), ast::AddressSpace::kPrivate);
auto args = overload.args(this);
auto*& arg_to_replace = (param.position == Position::kFirst) ? args.Front() : args.Back();
// Make the expression to be replaced, reachable. This keeps the resolver happy.
WrapInFunction(arg_to_replace);
arg_to_replace = Expr(Source{{12, 34}}, "G");
// Call the builtin with the constant-expression argument replaced
Func("func", utils::Empty, ty.void_(),
utils::Vector{
CallStmt(Call(overload.function, args)),

View File

@ -1663,50 +1663,29 @@ bool Validator::TextureBuiltinFunction(const sem::Call* call) const {
std::string name = sem::str(usage);
auto* arg = call->Arguments()[index];
if (auto values = arg->ConstantValue()) {
// Assert that the constant values are of the expected type.
if (!values->Type()->is_integer_scalar_or_vector()) {
TINT_ICE(Resolver, diagnostics_)
<< "failed to resolve '" + func_name + "' " << name << " parameter type";
return false;
}
// Currently const_expr is restricted to literals and type constructors.
// Check that that's all we have for the parameter.
bool is_const_expr = true;
ast::TraverseExpressions(
arg->Declaration(), diagnostics_, [&](const ast::Expression* e) {
if (e->IsAnyOf<ast::LiteralExpression, ast::CallExpression>()) {
return ast::TraverseAction::Descend;
}
is_const_expr = false;
return ast::TraverseAction::Stop;
});
if (is_const_expr) {
if (auto* vector = builtin->Parameters()[index]->Type()->As<sem::Vector>()) {
for (size_t i = 0; i < vector->Width(); i++) {
auto value = values->Index(i)->As<AInt>();
if (value < min || value > max) {
AddError("each component of the " + name +
" argument must be at least " + std::to_string(min) +
" and at most " + std::to_string(max) + ". " + name +
" component " + std::to_string(i) + " is " +
std::to_string(value),
arg->Declaration()->source);
return false;
}
}
} else {
auto value = values->As<AInt>();
if (auto* vector = values->Type()->As<sem::Vector>()) {
for (size_t i = 0; i < vector->Width(); i++) {
auto value = values->Index(i)->As<AInt>();
if (value < min || value > max) {
AddError("the " + name + " argument must be at least " +
AddError("each component of the " + name + " argument must be at least " +
std::to_string(min) + " and at most " + std::to_string(max) +
". " + name + " is " + std::to_string(value),
". " + name + " component " + std::to_string(i) + " is " +
std::to_string(value),
arg->Declaration()->source);
return false;
}
}
return true;
} else {
auto value = values->As<AInt>();
if (value < min || value > max) {
AddError("the " + name + " argument must be at least " + std::to_string(min) +
" and at most " + std::to_string(max) + ". " + name + " is " +
std::to_string(value),
arg->Declaration()->source);
return false;
}
}
return true;
}
AddError("the " + name + " argument must be a const-expression",
arg->Declaration()->source);

View File

@ -124,10 +124,10 @@ fn {{$permutation}}() {
{{template "Type" index $p.Type.TemplateArguments 1}};
{{- /*indent*/}} var arg_{{$i}}: {{template "Type" index $p.Type.TemplateArguments 1}};
{{ $args.Put $i (printf "&arg_%v" $i) -}}
{{- else if and (not $p.IsConst) (eq "var" $mode) -}}
{{- if $is_abstract }} const arg_{{$i}} = {{Eval "ArgumentValue" $p}};
{{ else }} var arg_{{$i}} = {{Eval "ArgumentValue" $p}};
{{ end }}
{{- else if eq "var" $mode -}}
{{- if or $is_abstract $p.IsConst }} const arg_{{$i}} = {{Eval "ArgumentValue" $p}};
{{ else }} var arg_{{$i}} = {{Eval "ArgumentValue" $p}};
{{ end }}
{{- $args.Put $i (printf "arg_%v" $i) -}}
{{- else -}}
{{- $args.Put $i (Eval "ArgumentValue" $p) -}}

View File

@ -26,7 +26,8 @@
// fn textureGather(texture: texture_depth_2d, sampler: sampler, coords: vec2<f32>, @const offset: vec2<i32>) -> vec4<f32>
fn textureGather_1f7f6b() {
var arg_2 = vec2<f32>();
var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, vec2<i32>());
const arg_3 = vec2<i32>();
var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3);
}
@vertex

View File

@ -4,7 +4,8 @@
fn textureGather_1f7f6b() {
var arg_2 = vec2<f32>();
var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, vec2<i32>());
const arg_3 = vec2<i32>();
var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3);
}
@vertex

View File

@ -25,9 +25,10 @@
// fn textureGather(@const component: i32, texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: i32) -> vec4<f32>
fn textureGather_22e930() {
const arg_0 = 1;
var arg_3 = vec2<f32>();
var arg_4 = 1;
var res: vec4<f32> = textureGather(1, arg_1, arg_2, arg_3, arg_4);
var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex

View File

@ -3,9 +3,10 @@
@group(1) @binding(2) var arg_2 : sampler;
fn textureGather_22e930() {
const arg_0 = 1;
var arg_3 = vec2<f32>();
var arg_4 = 1;
var res : vec4<f32> = textureGather(1, arg_1, arg_2, arg_3, arg_4);
var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex

View File

@ -25,9 +25,10 @@
// fn textureGather(@const component: i32, texture: texture_2d_array<u32>, sampler: sampler, coords: vec2<f32>, array_index: i32) -> vec4<u32>
fn textureGather_2cc066() {
const arg_0 = 1;
var arg_3 = vec2<f32>();
var arg_4 = 1;
var res: vec4<u32> = textureGather(1, arg_1, arg_2, arg_3, arg_4);
var res: vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex

View File

@ -3,9 +3,10 @@
@group(1) @binding(2) var arg_2 : sampler;
fn textureGather_2cc066() {
const arg_0 = 1;
var arg_3 = vec2<f32>();
var arg_4 = 1;
var res : vec4<u32> = textureGather(1, arg_1, arg_2, arg_3, arg_4);
var res : vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex

View File

@ -25,8 +25,9 @@
// fn textureGather(@const component: i32, texture: texture_cube<f32>, sampler: sampler, coords: vec3<f32>) -> vec4<f32>
fn textureGather_32c4e8() {
const arg_0 = 1;
var arg_3 = vec3<f32>();
var res: vec4<f32> = textureGather(1, arg_1, arg_2, arg_3);
var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3);
}
@vertex

View File

@ -3,8 +3,9 @@
@group(1) @binding(2) var arg_2 : sampler;
fn textureGather_32c4e8() {
const arg_0 = 1;
var arg_3 = vec3<f32>();
var res : vec4<f32> = textureGather(1, arg_1, arg_2, arg_3);
var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3);
}
@vertex

View File

@ -25,8 +25,9 @@
// fn textureGather(@const component: i32, texture: texture_cube<u32>, sampler: sampler, coords: vec3<f32>) -> vec4<u32>
fn textureGather_3b32cc() {
const arg_0 = 1;
var arg_3 = vec3<f32>();
var res: vec4<u32> = textureGather(1, arg_1, arg_2, arg_3);
var res: vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3);
}
@vertex

View File

@ -3,8 +3,9 @@
@group(1) @binding(2) var arg_2 : sampler;
fn textureGather_3b32cc() {
const arg_0 = 1;
var arg_3 = vec3<f32>();
var res : vec4<u32> = textureGather(1, arg_1, arg_2, arg_3);
var res : vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3);
}
@vertex

View File

@ -25,8 +25,10 @@
// fn textureGather(@const component: i32, texture: texture_2d<u32>, sampler: sampler, coords: vec2<f32>, @const offset: vec2<i32>) -> vec4<u32>
fn textureGather_49b07f() {
const arg_0 = 1;
var arg_3 = vec2<f32>();
var res: vec4<u32> = textureGather(1, arg_1, arg_2, arg_3, vec2<i32>());
const arg_4 = vec2<i32>();
var res: vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex

View File

@ -3,8 +3,10 @@
@group(1) @binding(2) var arg_2 : sampler;
fn textureGather_49b07f() {
const arg_0 = 1;
var arg_3 = vec2<f32>();
var res : vec4<u32> = textureGather(1, arg_1, arg_2, arg_3, vec2<i32>());
const arg_4 = vec2<i32>();
var res : vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex

View File

@ -25,9 +25,11 @@
// fn textureGather(@const component: i32, texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: i32, @const offset: vec2<i32>) -> vec4<f32>
fn textureGather_4b8103() {
const arg_0 = 1;
var arg_3 = vec2<f32>();
var arg_4 = 1;
var res: vec4<f32> = textureGather(1, arg_1, arg_2, arg_3, arg_4, vec2<i32>());
const arg_5 = vec2<i32>();
var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
}
@vertex

View File

@ -3,9 +3,11 @@
@group(1) @binding(2) var arg_2 : sampler;
fn textureGather_4b8103() {
const arg_0 = 1;
var arg_3 = vec2<f32>();
var arg_4 = 1;
var res : vec4<f32> = textureGather(1, arg_1, arg_2, arg_3, arg_4, vec2<i32>());
const arg_5 = vec2<i32>();
var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
}
@vertex

View File

@ -25,8 +25,9 @@
// fn textureGather(@const component: i32, texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>) -> vec4<f32>
fn textureGather_5266da() {
const arg_0 = 1;
var arg_3 = vec2<f32>();
var res: vec4<f32> = textureGather(1, arg_1, arg_2, arg_3);
var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3);
}
@vertex

View File

@ -3,8 +3,9 @@
@group(1) @binding(2) var arg_2 : sampler;
fn textureGather_5266da() {
const arg_0 = 1;
var arg_3 = vec2<f32>();
var res : vec4<f32> = textureGather(1, arg_1, arg_2, arg_3);
var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3);
}
@vertex

View File

@ -25,8 +25,9 @@
// fn textureGather(@const component: i32, texture: texture_cube<i32>, sampler: sampler, coords: vec3<f32>) -> vec4<i32>
fn textureGather_5ba85f() {
const arg_0 = 1;
var arg_3 = vec3<f32>();
var res: vec4<i32> = textureGather(1, arg_1, arg_2, arg_3);
var res: vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3);
}
@vertex

View File

@ -3,8 +3,9 @@
@group(1) @binding(2) var arg_2 : sampler;
fn textureGather_5ba85f() {
const arg_0 = 1;
var arg_3 = vec3<f32>();
var res : vec4<i32> = textureGather(1, arg_1, arg_2, arg_3);
var res : vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3);
}
@vertex

View File

@ -25,8 +25,9 @@
// fn textureGather(@const component: i32, texture: texture_2d<u32>, sampler: sampler, coords: vec2<f32>) -> vec4<u32>
fn textureGather_5bd491() {
const arg_0 = 1;
var arg_3 = vec2<f32>();
var res: vec4<u32> = textureGather(1, arg_1, arg_2, arg_3);
var res: vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3);
}
@vertex

View File

@ -3,8 +3,9 @@
@group(1) @binding(2) var arg_2 : sampler;
fn textureGather_5bd491() {
const arg_0 = 1;
var arg_3 = vec2<f32>();
var res : vec4<u32> = textureGather(1, arg_1, arg_2, arg_3);
var res : vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3);
}
@vertex

View File

@ -25,9 +25,10 @@
// fn textureGather(@const component: i32, texture: texture_cube_array<f32>, sampler: sampler, coords: vec3<f32>, array_index: i32) -> vec4<f32>
fn textureGather_751f8a() {
const arg_0 = 1;
var arg_3 = vec3<f32>();
var arg_4 = 1;
var res: vec4<f32> = textureGather(1, arg_1, arg_2, arg_3, arg_4);
var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex

View File

@ -3,9 +3,10 @@
@group(1) @binding(2) var arg_2 : sampler;
fn textureGather_751f8a() {
const arg_0 = 1;
var arg_3 = vec3<f32>();
var arg_4 = 1;
var res : vec4<f32> = textureGather(1, arg_1, arg_2, arg_3, arg_4);
var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex

View File

@ -25,8 +25,10 @@
// fn textureGather(@const component: i32, texture: texture_2d<i32>, sampler: sampler, coords: vec2<f32>, @const offset: vec2<i32>) -> vec4<i32>
fn textureGather_7c3828() {
const arg_0 = 1;
var arg_3 = vec2<f32>();
var res: vec4<i32> = textureGather(1, arg_1, arg_2, arg_3, vec2<i32>());
const arg_4 = vec2<i32>();
var res: vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex

View File

@ -3,8 +3,10 @@
@group(1) @binding(2) var arg_2 : sampler;
fn textureGather_7c3828() {
const arg_0 = 1;
var arg_3 = vec2<f32>();
var res : vec4<i32> = textureGather(1, arg_1, arg_2, arg_3, vec2<i32>());
const arg_4 = vec2<i32>();
var res : vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex

View File

@ -25,9 +25,10 @@
// fn textureGather(@const component: i32, texture: texture_2d_array<i32>, sampler: sampler, coords: vec2<f32>, array_index: i32) -> vec4<i32>
fn textureGather_8b754c() {
const arg_0 = 1;
var arg_3 = vec2<f32>();
var arg_4 = 1;
var res: vec4<i32> = textureGather(1, arg_1, arg_2, arg_3, arg_4);
var res: vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex

View File

@ -3,9 +3,10 @@
@group(1) @binding(2) var arg_2 : sampler;
fn textureGather_8b754c() {
const arg_0 = 1;
var arg_3 = vec2<f32>();
var arg_4 = 1;
var res : vec4<i32> = textureGather(1, arg_1, arg_2, arg_3, arg_4);
var res : vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex

View File

@ -25,8 +25,10 @@
// fn textureGather(@const component: i32, texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, @const offset: vec2<i32>) -> vec4<f32>
fn textureGather_af55b3() {
const arg_0 = 1;
var arg_3 = vec2<f32>();
var res: vec4<f32> = textureGather(1, arg_1, arg_2, arg_3, vec2<i32>());
const arg_4 = vec2<i32>();
var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex

View File

@ -3,8 +3,10 @@
@group(1) @binding(2) var arg_2 : sampler;
fn textureGather_af55b3() {
const arg_0 = 1;
var arg_3 = vec2<f32>();
var res : vec4<f32> = textureGather(1, arg_1, arg_2, arg_3, vec2<i32>());
const arg_4 = vec2<i32>();
var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex

View File

@ -25,8 +25,9 @@
// fn textureGather(@const component: i32, texture: texture_2d<i32>, sampler: sampler, coords: vec2<f32>) -> vec4<i32>
fn textureGather_bb3ac5() {
const arg_0 = 1;
var arg_3 = vec2<f32>();
var res: vec4<i32> = textureGather(1, arg_1, arg_2, arg_3);
var res: vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3);
}
@vertex

View File

@ -3,8 +3,9 @@
@group(1) @binding(2) var arg_2 : sampler;
fn textureGather_bb3ac5() {
const arg_0 = 1;
var arg_3 = vec2<f32>();
var res : vec4<i32> = textureGather(1, arg_1, arg_2, arg_3);
var res : vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3);
}
@vertex

View File

@ -25,9 +25,10 @@
// fn textureGather(@const component: i32, texture: texture_cube_array<i32>, sampler: sampler, coords: vec3<f32>, array_index: i32) -> vec4<i32>
fn textureGather_c0640c() {
const arg_0 = 1;
var arg_3 = vec3<f32>();
var arg_4 = 1;
var res: vec4<i32> = textureGather(1, arg_1, arg_2, arg_3, arg_4);
var res: vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex

View File

@ -3,9 +3,10 @@
@group(1) @binding(2) var arg_2 : sampler;
fn textureGather_c0640c() {
const arg_0 = 1;
var arg_3 = vec3<f32>();
var arg_4 = 1;
var res : vec4<i32> = textureGather(1, arg_1, arg_2, arg_3, arg_4);
var res : vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex

View File

@ -25,9 +25,11 @@
// fn textureGather(@const component: i32, texture: texture_2d_array<u32>, sampler: sampler, coords: vec2<f32>, array_index: i32, @const offset: vec2<i32>) -> vec4<u32>
fn textureGather_d1f187() {
const arg_0 = 1;
var arg_3 = vec2<f32>();
var arg_4 = 1;
var res: vec4<u32> = textureGather(1, arg_1, arg_2, arg_3, arg_4, vec2<i32>());
const arg_5 = vec2<i32>();
var res: vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
}
@vertex

View File

@ -3,9 +3,11 @@
@group(1) @binding(2) var arg_2 : sampler;
fn textureGather_d1f187() {
const arg_0 = 1;
var arg_3 = vec2<f32>();
var arg_4 = 1;
var res : vec4<u32> = textureGather(1, arg_1, arg_2, arg_3, arg_4, vec2<i32>());
const arg_5 = vec2<i32>();
var res : vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
}
@vertex

View File

@ -27,7 +27,8 @@
fn textureGather_d90605() {
var arg_2 = vec2<f32>();
var arg_3 = 1;
var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, vec2<i32>());
const arg_4 = vec2<i32>();
var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex

View File

@ -5,7 +5,8 @@
fn textureGather_d90605() {
var arg_2 = vec2<f32>();
var arg_3 = 1;
var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, vec2<i32>());
const arg_4 = vec2<i32>();
var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex

View File

@ -25,9 +25,11 @@
// fn textureGather(@const component: i32, texture: texture_2d_array<i32>, sampler: sampler, coords: vec2<f32>, array_index: i32, @const offset: vec2<i32>) -> vec4<i32>
fn textureGather_e9d390() {
const arg_0 = 1;
var arg_3 = vec2<f32>();
var arg_4 = 1;
var res: vec4<i32> = textureGather(1, arg_1, arg_2, arg_3, arg_4, vec2<i32>());
const arg_5 = vec2<i32>();
var res: vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
}
@vertex

View File

@ -3,9 +3,11 @@
@group(1) @binding(2) var arg_2 : sampler;
fn textureGather_e9d390() {
const arg_0 = 1;
var arg_3 = vec2<f32>();
var arg_4 = 1;
var res : vec4<i32> = textureGather(1, arg_1, arg_2, arg_3, arg_4, vec2<i32>());
const arg_5 = vec2<i32>();
var res : vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
}
@vertex

View File

@ -25,9 +25,10 @@
// fn textureGather(@const component: i32, texture: texture_cube_array<u32>, sampler: sampler, coords: vec3<f32>, array_index: i32) -> vec4<u32>
fn textureGather_f2c6e3() {
const arg_0 = 1;
var arg_3 = vec3<f32>();
var arg_4 = 1;
var res: vec4<u32> = textureGather(1, arg_1, arg_2, arg_3, arg_4);
var res: vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex

View File

@ -3,9 +3,10 @@
@group(1) @binding(2) var arg_2 : sampler;
fn textureGather_f2c6e3() {
const arg_0 = 1;
var arg_3 = vec3<f32>();
var arg_4 = 1;
var res : vec4<u32> = textureGather(1, arg_1, arg_2, arg_3, arg_4);
var res : vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex

View File

@ -27,7 +27,8 @@
fn textureGatherCompare_313add() {
var arg_2 = vec2<f32>();
var arg_3 = 1.f;
var res: vec4<f32> = textureGatherCompare(arg_0, arg_1, arg_2, arg_3, vec2<i32>());
const arg_4 = vec2<i32>();
var res: vec4<f32> = textureGatherCompare(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex

View File

@ -5,7 +5,8 @@
fn textureGatherCompare_313add() {
var arg_2 = vec2<f32>();
var arg_3 = 1.0f;
var res : vec4<f32> = textureGatherCompare(arg_0, arg_1, arg_2, arg_3, vec2<i32>());
const arg_4 = vec2<i32>();
var res : vec4<f32> = textureGatherCompare(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex

View File

@ -28,7 +28,8 @@ fn textureGatherCompare_f585cc() {
var arg_2 = vec2<f32>();
var arg_3 = 1;
var arg_4 = 1.f;
var res: vec4<f32> = textureGatherCompare(arg_0, arg_1, arg_2, arg_3, arg_4, vec2<i32>());
const arg_5 = vec2<i32>();
var res: vec4<f32> = textureGatherCompare(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
}
@vertex

View File

@ -6,7 +6,8 @@ fn textureGatherCompare_f585cc() {
var arg_2 = vec2<f32>();
var arg_3 = 1;
var arg_4 = 1.0f;
var res : vec4<f32> = textureGatherCompare(arg_0, arg_1, arg_2, arg_3, arg_4, vec2<i32>());
const arg_5 = vec2<i32>();
var res : vec4<f32> = textureGatherCompare(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
}
@vertex

View File

@ -26,7 +26,8 @@
// fn textureSample(texture: texture_depth_2d, sampler: sampler, coords: vec2<f32>, @const offset: vec2<i32>) -> f32
fn textureSample_0dff6c() {
var arg_2 = vec2<f32>();
var res: f32 = textureSample(arg_0, arg_1, arg_2, vec2<i32>());
const arg_3 = vec2<i32>();
var res: f32 = textureSample(arg_0, arg_1, arg_2, arg_3);
}
@fragment

View File

@ -4,7 +4,8 @@
fn textureSample_0dff6c() {
var arg_2 = vec2<f32>();
var res : f32 = textureSample(arg_0, arg_1, arg_2, vec2<i32>());
const arg_3 = vec2<i32>();
var res : f32 = textureSample(arg_0, arg_1, arg_2, arg_3);
}
@fragment

View File

@ -27,7 +27,8 @@
fn textureSample_17e988() {
var arg_2 = vec2<f32>();
var arg_3 = 1;
var res: vec4<f32> = textureSample(arg_0, arg_1, arg_2, arg_3, vec2<i32>());
const arg_4 = vec2<i32>();
var res: vec4<f32> = textureSample(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@fragment

View File

@ -5,7 +5,8 @@
fn textureSample_17e988() {
var arg_2 = vec2<f32>();
var arg_3 = 1;
var res : vec4<f32> = textureSample(arg_0, arg_1, arg_2, arg_3, vec2<i32>());
const arg_4 = vec2<i32>();
var res : vec4<f32> = textureSample(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@fragment

View File

@ -26,7 +26,8 @@
// fn textureSample(texture: texture_3d<f32>, sampler: sampler, coords: vec3<f32>, @const offset: vec3<i32>) -> vec4<f32>
fn textureSample_2149ec() {
var arg_2 = vec3<f32>();
var res: vec4<f32> = textureSample(arg_0, arg_1, arg_2, vec3<i32>());
const arg_3 = vec3<i32>();
var res: vec4<f32> = textureSample(arg_0, arg_1, arg_2, arg_3);
}
@fragment

View File

@ -4,7 +4,8 @@
fn textureSample_2149ec() {
var arg_2 = vec3<f32>();
var res : vec4<f32> = textureSample(arg_0, arg_1, arg_2, vec3<i32>());
const arg_3 = vec3<i32>();
var res : vec4<f32> = textureSample(arg_0, arg_1, arg_2, arg_3);
}
@fragment

View File

@ -27,7 +27,8 @@
fn textureSample_60bf45() {
var arg_2 = vec2<f32>();
var arg_3 = 1;
var res: f32 = textureSample(arg_0, arg_1, arg_2, arg_3, vec2<i32>());
const arg_4 = vec2<i32>();
var res: f32 = textureSample(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@fragment

View File

@ -5,7 +5,8 @@
fn textureSample_60bf45() {
var arg_2 = vec2<f32>();
var arg_3 = 1;
var res : f32 = textureSample(arg_0, arg_1, arg_2, arg_3, vec2<i32>());
const arg_4 = vec2<i32>();
var res : f32 = textureSample(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@fragment

View File

@ -26,7 +26,8 @@
// fn textureSample(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, @const offset: vec2<i32>) -> vec4<f32>
fn textureSample_85c4ba() {
var arg_2 = vec2<f32>();
var res: vec4<f32> = textureSample(arg_0, arg_1, arg_2, vec2<i32>());
const arg_3 = vec2<i32>();
var res: vec4<f32> = textureSample(arg_0, arg_1, arg_2, arg_3);
}
@fragment

View File

@ -4,7 +4,8 @@
fn textureSample_85c4ba() {
var arg_2 = vec2<f32>();
var res : vec4<f32> = textureSample(arg_0, arg_1, arg_2, vec2<i32>());
const arg_3 = vec2<i32>();
var res : vec4<f32> = textureSample(arg_0, arg_1, arg_2, arg_3);
}
@fragment

View File

@ -27,7 +27,8 @@
fn textureSampleBias_594824() {
var arg_2 = vec3<f32>();
var arg_3 = 1.f;
var res: vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3, vec3<i32>());
const arg_4 = vec3<i32>();
var res: vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@fragment

View File

@ -5,7 +5,8 @@
fn textureSampleBias_594824() {
var arg_2 = vec3<f32>();
var arg_3 = 1.0f;
var res : vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3, vec3<i32>());
const arg_4 = vec3<i32>();
var res : vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@fragment

View File

@ -28,7 +28,8 @@ fn textureSampleBias_9dbb51() {
var arg_2 = vec2<f32>();
var arg_3 = 1;
var arg_4 = 1.f;
var res: vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3, arg_4, vec2<i32>());
const arg_5 = vec2<i32>();
var res: vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
}
@fragment

View File

@ -6,7 +6,8 @@ fn textureSampleBias_9dbb51() {
var arg_2 = vec2<f32>();
var arg_3 = 1;
var arg_4 = 1.0f;
var res : vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3, arg_4, vec2<i32>());
const arg_5 = vec2<i32>();
var res : vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
}
@fragment

View File

@ -27,7 +27,8 @@
fn textureSampleBias_a161cf() {
var arg_2 = vec2<f32>();
var arg_3 = 1.f;
var res: vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3, vec2<i32>());
const arg_4 = vec2<i32>();
var res: vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@fragment

View File

@ -5,7 +5,8 @@
fn textureSampleBias_a161cf() {
var arg_2 = vec2<f32>();
var arg_3 = 1.0f;
var res : vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3, vec2<i32>());
const arg_4 = vec2<i32>();
var res : vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@fragment

View File

@ -28,7 +28,8 @@ fn textureSampleCompare_af1051() {
var arg_2 = vec2<f32>();
var arg_3 = 1;
var arg_4 = 1.f;
var res: f32 = textureSampleCompare(arg_0, arg_1, arg_2, arg_3, arg_4, vec2<i32>());
const arg_5 = vec2<i32>();
var res: f32 = textureSampleCompare(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
}
@fragment

View File

@ -6,7 +6,8 @@ fn textureSampleCompare_af1051() {
var arg_2 = vec2<f32>();
var arg_3 = 1;
var arg_4 = 1.0f;
var res : f32 = textureSampleCompare(arg_0, arg_1, arg_2, arg_3, arg_4, vec2<i32>());
const arg_5 = vec2<i32>();
var res : f32 = textureSampleCompare(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
}
@fragment

View File

@ -27,7 +27,8 @@
fn textureSampleCompare_dec064() {
var arg_2 = vec2<f32>();
var arg_3 = 1.f;
var res: f32 = textureSampleCompare(arg_0, arg_1, arg_2, arg_3, vec2<i32>());
const arg_4 = vec2<i32>();
var res: f32 = textureSampleCompare(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@fragment

View File

@ -5,7 +5,8 @@
fn textureSampleCompare_dec064() {
var arg_2 = vec2<f32>();
var arg_3 = 1.0f;
var res : f32 = textureSampleCompare(arg_0, arg_1, arg_2, arg_3, vec2<i32>());
const arg_4 = vec2<i32>();
var res : f32 = textureSampleCompare(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@fragment

View File

@ -27,7 +27,8 @@
fn textureSampleCompareLevel_7f2b9a() {
var arg_2 = vec2<f32>();
var arg_3 = 1.f;
var res: f32 = textureSampleCompareLevel(arg_0, arg_1, arg_2, arg_3, vec2<i32>());
const arg_4 = vec2<i32>();
var res: f32 = textureSampleCompareLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex

View File

@ -5,7 +5,8 @@
fn textureSampleCompareLevel_7f2b9a() {
var arg_2 = vec2<f32>();
var arg_3 = 1.0f;
var res : f32 = textureSampleCompareLevel(arg_0, arg_1, arg_2, arg_3, vec2<i32>());
const arg_4 = vec2<i32>();
var res : f32 = textureSampleCompareLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex

View File

@ -28,7 +28,8 @@ fn textureSampleCompareLevel_b6e47c() {
var arg_2 = vec2<f32>();
var arg_3 = 1;
var arg_4 = 1.f;
var res: f32 = textureSampleCompareLevel(arg_0, arg_1, arg_2, arg_3, arg_4, vec2<i32>());
const arg_5 = vec2<i32>();
var res: f32 = textureSampleCompareLevel(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
}
@vertex

View File

@ -6,7 +6,8 @@ fn textureSampleCompareLevel_b6e47c() {
var arg_2 = vec2<f32>();
var arg_3 = 1;
var arg_4 = 1.0f;
var res : f32 = textureSampleCompareLevel(arg_0, arg_1, arg_2, arg_3, arg_4, vec2<i32>());
const arg_5 = vec2<i32>();
var res : f32 = textureSampleCompareLevel(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
}
@vertex

View File

@ -28,7 +28,8 @@ fn textureSampleGrad_5884dd() {
var arg_2 = vec3<f32>();
var arg_3 = vec3<f32>();
var arg_4 = vec3<f32>();
var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4, vec3<i32>());
const arg_5 = vec3<i32>();
var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
}
@vertex

View File

@ -6,7 +6,8 @@ fn textureSampleGrad_5884dd() {
var arg_2 = vec3<f32>();
var arg_3 = vec3<f32>();
var arg_4 = vec3<f32>();
var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4, vec3<i32>());
const arg_5 = vec3<i32>();
var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
}
@vertex

View File

@ -28,7 +28,8 @@ fn textureSampleGrad_d4e3c5() {
var arg_2 = vec2<f32>();
var arg_3 = vec2<f32>();
var arg_4 = vec2<f32>();
var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4, vec2<i32>());
const arg_5 = vec2<i32>();
var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
}
@vertex

View File

@ -6,7 +6,8 @@ fn textureSampleGrad_d4e3c5() {
var arg_2 = vec2<f32>();
var arg_3 = vec2<f32>();
var arg_4 = vec2<f32>();
var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4, vec2<i32>());
const arg_5 = vec2<i32>();
var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
}
@vertex

View File

@ -29,7 +29,8 @@ fn textureSampleGrad_d65515() {
var arg_3 = 1;
var arg_4 = vec2<f32>();
var arg_5 = vec2<f32>();
var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, vec2<i32>());
const arg_6 = vec2<i32>();
var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6);
}
@vertex

View File

@ -7,7 +7,8 @@ fn textureSampleGrad_d65515() {
var arg_3 = 1;
var arg_4 = vec2<f32>();
var arg_5 = vec2<f32>();
var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, vec2<i32>());
const arg_6 = vec2<i32>();
var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6);
}
@vertex

View File

@ -27,7 +27,8 @@
fn textureSampleLevel_0b0a1b() {
var arg_2 = vec2<f32>();
var arg_3 = 1.f;
var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, vec2<i32>());
const arg_4 = vec2<i32>();
var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex

View File

@ -5,7 +5,8 @@
fn textureSampleLevel_0b0a1b() {
var arg_2 = vec2<f32>();
var arg_3 = 1.0f;
var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, vec2<i32>());
const arg_4 = vec2<i32>();
var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex

View File

@ -28,7 +28,8 @@ fn textureSampleLevel_36780e() {
var arg_2 = vec2<f32>();
var arg_3 = 1;
var arg_4 = 0;
var res: f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4, vec2<i32>());
const arg_5 = vec2<i32>();
var res: f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
}
@vertex

View File

@ -6,7 +6,8 @@ fn textureSampleLevel_36780e() {
var arg_2 = vec2<f32>();
var arg_3 = 1;
var arg_4 = 0;
var res : f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4, vec2<i32>());
const arg_5 = vec2<i32>();
var res : f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
}
@vertex

View File

@ -27,7 +27,8 @@
fn textureSampleLevel_749baf() {
var arg_2 = vec2<f32>();
var arg_3 = 0;
var res: f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, vec2<i32>());
const arg_4 = vec2<i32>();
var res: f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex

View File

@ -5,7 +5,8 @@
fn textureSampleLevel_749baf() {
var arg_2 = vec2<f32>();
var arg_3 = 0;
var res : f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, vec2<i32>());
const arg_4 = vec2<i32>();
var res : f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex

View File

@ -28,7 +28,8 @@ fn textureSampleLevel_b7c55c() {
var arg_2 = vec2<f32>();
var arg_3 = 1;
var arg_4 = 1.f;
var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4, vec2<i32>());
const arg_5 = vec2<i32>();
var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
}
@vertex

View File

@ -6,7 +6,8 @@ fn textureSampleLevel_b7c55c() {
var arg_2 = vec2<f32>();
var arg_3 = 1;
var arg_4 = 1.0f;
var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4, vec2<i32>());
const arg_5 = vec2<i32>();
var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
}
@vertex

View File

@ -27,7 +27,8 @@
fn textureSampleLevel_dcbecb() {
var arg_2 = vec3<f32>();
var arg_3 = 1.f;
var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, vec3<i32>());
const arg_4 = vec3<i32>();
var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex

View File

@ -5,7 +5,8 @@
fn textureSampleLevel_dcbecb() {
var arg_2 = vec3<f32>();
var arg_3 = 1.0f;
var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, vec3<i32>());
const arg_4 = vec3<i32>();
var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
}
@vertex