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

@@ -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