tint: Allow signed / unsigned texture builtin params

Bug: tint:1526
Change-Id: I301a9ba6e94b162a1ffb436be3e3212b723b7401
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106682
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton
2022-10-24 23:58:53 +00:00
committed by Dawn LUCI CQ
parent d96f7c22ed
commit da5424b617
2695 changed files with 104817 additions and 6612 deletions

View File

@@ -464,7 +464,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
},
{
ValidTextureOverload::kGather2dOffsetF32,
"textureGather(component : i32,\n"
"textureGather(component : u32,\n"
" t : texture_2d<T>,\n"
" s : sampler,\n"
" coords : vec2<f32>,\n"
@@ -475,7 +475,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
TextureDataType::kF32,
"textureGather",
[](ProgramBuilder* b) {
return b->ExprList(0_i, // component
return b->ExprList(0_u, // component
"texture", // t
"sampler", // s
b->vec2<f32>(1_f, 2_f), // coords
@@ -504,11 +504,11 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
},
{
ValidTextureOverload::kGather2dArrayOffsetF32,
"textureGather(component : i32,\n"
"textureGather(component : u32,\n"
" t : texture_2d_array<T>,\n"
" s : sampler,\n"
" coords : vec2<f32>,\n"
" array_index : i32,\n"
" array_index : u32,\n"
" offset : vec2<i32>) -> vec4<T>",
TextureKind::kRegular,
ast::SamplerKind::kSampler,
@@ -516,11 +516,11 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
TextureDataType::kF32,
"textureGather",
[](ProgramBuilder* b) {
return b->ExprList(0_i, // component
return b->ExprList(0_u, // component
"texture", // t
"sampler", // s
b->vec2<f32>(1_f, 2_f), // coords
3_i, // array_index
3_u, // array_index
b->vec2<i32>(4_i, 5_i)); // offset
},
},
@@ -544,22 +544,22 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
},
{
ValidTextureOverload::kGatherCubeArrayF32,
"textureGather(component : i32,\n"
"textureGather(component : u32,\n"
" t : texture_cube_array<T>,\n"
" s : sampler,\n"
" coords : vec3<f32>,\n"
" array_index : i32) -> vec4<T>",
" array_index : u32) -> vec4<T>",
TextureKind::kRegular,
ast::SamplerKind::kSampler,
ast::TextureDimension::kCubeArray,
TextureDataType::kF32,
"textureGather",
[](ProgramBuilder* b) {
return b->ExprList(0_i, // component
return b->ExprList(0_u, // component
"texture", // t
"sampler", // s
b->vec3<f32>(1_f, 2_f, 3_f), // coords
4_i); // array_index
4_u); // array_index
},
},
{
@@ -601,7 +601,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
"textureGather(t : texture_depth_2d_array,\n"
" s : sampler,\n"
" coords : vec2<f32>,\n"
" array_index : i32) -> vec4<f32>",
" array_index : u32) -> vec4<f32>",
TextureKind::kDepth,
ast::SamplerKind::kSampler,
ast::TextureDimension::k2dArray,
@@ -611,7 +611,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
return b->ExprList("texture", // t
"sampler", // s
b->vec2<f32>(1_f, 2_f), // coords
3_i); // array_index
3_u); // array_index
},
},
{
@@ -655,7 +655,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
"textureGather(t : texture_depth_cube_array,\n"
" s : sampler,\n"
" coords : vec3<f32>,\n"
" array_index : i32) -> vec4<f32>",
" array_index : u32) -> vec4<f32>",
TextureKind::kDepth,
ast::SamplerKind::kSampler,
ast::TextureDimension::kCubeArray,
@@ -665,7 +665,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
return b->ExprList("texture", // t
"sampler", // s
b->vec3<f32>(1_f, 2_f, 3_f), // coords
4_i); // array_index
4_u); // array_index
},
},
{
@@ -771,7 +771,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
"textureGatherCompare(t : texture_depth_cube_array,\n"
" s : sampler_comparison,\n"
" coords : vec3<f32>,\n"
" array_index : i32,\n"
" array_index : u32,\n"
" depth_ref : f32) -> vec4<f32>",
TextureKind::kDepth,
ast::SamplerKind::kComparisonSampler,
@@ -782,7 +782,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
return b->ExprList("texture", // t
"sampler", // s
b->vec3<f32>(1_f, 2_f, 3_f), // coords
4_i, // array_index
4_u, // array_index
5_f); // depth_ref
},
},
@@ -1009,7 +1009,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
"textureSample(t : texture_2d_array<f32>,\n"
" s : sampler,\n"
" coords : vec2<f32>,\n"
" array_index : i32\n"
" array_index : u32\n"
" offset : vec2<i32>) -> vec4<f32>",
TextureKind::kRegular,
ast::SamplerKind::kSampler,
@@ -1020,7 +1020,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
return b->ExprList("texture", // t
"sampler", // s
b->vec2<f32>(1_f, 2_f), // coords
3_i, // array_index
3_u, // array_index
b->vec2<i32>(4_i, 5_i)); // offset
},
},
@@ -1185,7 +1185,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
"textureSample(t : texture_depth_cube_array,\n"
" s : sampler,\n"
" coords : vec3<f32>,\n"
" array_index : i32) -> f32",
" array_index : u32) -> f32",
TextureKind::kDepth,
ast::SamplerKind::kSampler,
ast::TextureDimension::kCubeArray,
@@ -1195,7 +1195,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
return b->ExprList("texture", // t
"sampler", // s
b->vec3<f32>(1_f, 2_f, 3_f), // coords
4_i); // array_index
4_u); // array_index
},
},
{
@@ -1241,7 +1241,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
"textureSampleBias(t : texture_2d_array<f32>,\n"
" s : sampler,\n"
" coords : vec2<f32>,\n"
" array_index : i32,\n"
" array_index : u32,\n"
" bias : f32) -> vec4<f32>",
TextureKind::kRegular,
ast::SamplerKind::kSampler,
@@ -1252,7 +1252,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
return b->ExprList("texture", // t
"sampler", // s
b->vec2<f32>(1_f, 2_f), // coords
4_i, // array_index
4_u, // array_index
3_f); // bias
},
},
@@ -1515,7 +1515,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
"textureSampleLevel(t : texture_depth_2d,\n"
" s : sampler,\n"
" coords : vec2<f32>,\n"
" level : i32) -> f32",
" level : u32) -> f32",
TextureKind::kDepth,
ast::SamplerKind::kSampler,
ast::TextureDimension::k2d,
@@ -1525,7 +1525,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
return b->ExprList("texture", // t
"sampler", // s
b->vec2<f32>(1_f, 2_f), // coords
3_i); // level
3_u); // level
},
},
{
@@ -1553,8 +1553,8 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
"textureSampleLevel(t : texture_depth_2d_array,\n"
" s : sampler,\n"
" coords : vec2<f32>,\n"
" array_index : i32,\n"
" level : i32) -> f32",
" array_index : u32,\n"
" level : u32) -> f32",
TextureKind::kDepth,
ast::SamplerKind::kSampler,
ast::TextureDimension::k2dArray,
@@ -1564,8 +1564,8 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
return b->ExprList("texture", // t
"sampler", // s
b->vec2<f32>(1_f, 2_f), // coords
3_i, // array_index
4_i); // level
3_u, // array_index
4_u); // level
},
},
{
@@ -1573,8 +1573,8 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
"textureSampleLevel(t : texture_depth_2d_array,\n"
" s : sampler,\n"
" coords : vec2<f32>,\n"
" array_index : i32,\n"
" level : i32,\n"
" array_index : u32,\n"
" level : u32,\n"
" offset : vec2<i32>) -> f32",
TextureKind::kDepth,
ast::SamplerKind::kSampler,
@@ -1585,8 +1585,8 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
return b->ExprList("texture", // t
"sampler", // s
b->vec2<f32>(1_f, 2_f), // coords
3_i, // array_index
4_i, // level
3_u, // array_index
4_u, // level
b->vec2<i32>(5_i, 6_i)); // offset
},
},
@@ -1697,7 +1697,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
"textureSampleGrad(t : texture_2d_array<f32>,\n"
" s : sampler,\n"
" coords : vec2<f32>,\n"
" array_index : i32,\n"
" array_index : u32,\n"
" ddx : vec2<f32>,\n"
" ddy : vec2<f32>,\n"
" offset : vec2<i32>) -> vec4<f32>",
@@ -1710,7 +1710,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
return b->ExprList("texture", // t
"sampler", // s
b->vec2<f32>(1_f, 2_f), // coords
3_i, // array_index
3_u, // array_index
b->vec2<f32>(4_f, 5_f), // ddx
b->vec2<f32>(6_f, 7_f), // ddy
b->vec2<i32>(6_i, 7_i)); // offset
@@ -1783,7 +1783,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
"textureSampleGrad(t : texture_cube_array<f32>,\n"
" s : sampler,\n"
" coords : vec3<f32>,\n"
" array_index : i32,\n"
" array_index : u32,\n"
" ddx : vec3<f32>,\n"
" ddy : vec3<f32>) -> vec4<f32>",
TextureKind::kRegular,
@@ -1795,7 +1795,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
return b->ExprList("texture", // t
"sampler", // s
b->vec3<f32>(1_f, 2_f, 3_f), // coords
4_i, // array_index
4_u, // array_index
b->vec3<f32>(5_f, 6_f, 7_f), // ddx
b->vec3<f32>(8_f, 9_f, 10_f)); // ddy
},
@@ -1863,7 +1863,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
"textureSampleCompare(t : texture_depth_2d_array,\n"
" s : sampler_comparison,\n"
" coords : vec2<f32>,\n"
" array_index : i32,\n"
" array_index : u32,\n"
" depth_ref : f32,\n"
" offset : vec2<i32>) -> f32",
TextureKind::kDepth,
@@ -1875,7 +1875,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
return b->ExprList("texture", // t
"sampler", // s
b->vec2<f32>(1_f, 2_f), // coords
4_i, // array_index
4_u, // array_index
3_f, // depth_ref
b->vec2<i32>(5_i, 6_i)); // offset
},
@@ -1921,16 +1921,16 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
{
ValidTextureOverload::kLoad1dLevelF32,
"textureLoad(t : texture_1d<f32>,\n"
" coords : i32,\n"
" level : i32) -> vec4<f32>",
" coords : u32,\n"
" level : u32) -> vec4<f32>",
TextureKind::kRegular,
ast::TextureDimension::k1d,
TextureDataType::kF32,
"textureLoad",
[](ProgramBuilder* b) {
return b->ExprList("texture", // t
1_i, // coords
3_i); // level
1_u, // coords
3_u); // level
},
},
{
@@ -1966,16 +1966,16 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
{
ValidTextureOverload::kLoad2dLevelF32,
"textureLoad(t : texture_2d<f32>,\n"
" coords : vec2<i32>,\n"
" level : i32) -> vec4<f32>",
" coords : vec2<u32>,\n"
" level : u32) -> vec4<f32>",
TextureKind::kRegular,
ast::TextureDimension::k2d,
TextureDataType::kF32,
"textureLoad",
[](ProgramBuilder* b) {
return b->ExprList("texture", // t
b->vec2<i32>(1_i, 2_i), // coords
3_i); // level
b->vec2<u32>(1_u, 2_u), // coords
3_u); // level
},
},
{
@@ -1996,16 +1996,16 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
{
ValidTextureOverload::kLoad2dLevelI32,
"textureLoad(t : texture_2d<i32>,\n"
" coords : vec2<i32>,\n"
" level : i32) -> vec4<i32>",
" coords : vec2<u32>,\n"
" level : u32) -> vec4<i32>",
TextureKind::kRegular,
ast::TextureDimension::k2d,
TextureDataType::kI32,
"textureLoad",
[](ProgramBuilder* b) {
return b->ExprList("texture", // t
b->vec2<i32>(1_i, 2_i), // coords
3_i); // level
b->vec2<u32>(1_u, 2_u), // coords
3_u); // level
},
},
{
@@ -2045,18 +2045,18 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
{
ValidTextureOverload::kLoad2dArrayLevelI32,
"textureLoad(t : texture_2d_array<i32>,\n"
" coords : vec2<i32>,\n"
" array_index : i32,\n"
" level : i32) -> vec4<i32>",
" coords : vec2<u32>,\n"
" array_index : u32,\n"
" level : u32) -> vec4<i32>",
TextureKind::kRegular,
ast::TextureDimension::k2dArray,
TextureDataType::kI32,
"textureLoad",
[](ProgramBuilder* b) {
return b->ExprList("texture", // t
b->vec2<i32>(1_i, 2_i), // coords
3_i, // array_index
4_i); // level
b->vec2<u32>(1_u, 2_u), // coords
3_u, // array_index
4_u); // level
},
},
{
@@ -2092,16 +2092,16 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
{
ValidTextureOverload::kLoad3dLevelI32,
"textureLoad(t : texture_3d<i32>,\n"
" coords : vec3<i32>,\n"
" level : i32) -> vec4<i32>",
" coords : vec3<u32>,\n"
" level : u32) -> vec4<i32>",
TextureKind::kRegular,
ast::TextureDimension::k3d,
TextureDataType::kI32,
"textureLoad",
[](ProgramBuilder* b) {
return b->ExprList("texture", // t
b->vec3<i32>(1_i, 2_i, 3_i), // coords
4_i); // level
b->vec3<u32>(1_u, 2_u, 3_u), // coords
4_u); // level
},
},
{
@@ -2137,16 +2137,16 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
{
ValidTextureOverload::kLoadMultisampled2dI32,
"textureLoad(t : texture_multisampled_2d<i32>,\n"
" coords : vec2<i32>,\n"
" sample_index : i32) -> vec4<i32>",
" coords : vec2<u32>,\n"
" sample_index : u32) -> vec4<i32>",
TextureKind::kMultisampled,
ast::TextureDimension::k2d,
TextureDataType::kI32,
"textureLoad",
[](ProgramBuilder* b) {
return b->ExprList("texture", // t
b->vec2<i32>(1_i, 2_i), // coords
3_i); // sample_index
b->vec2<u32>(1_u, 2_u), // coords
3_u); // sample_index
},
},
{
@@ -2167,18 +2167,18 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
{
ValidTextureOverload::kLoadDepth2dArrayLevelF32,
"textureLoad(t : texture_depth_2d_array,\n"
" coords : vec2<i32>,\n"
" array_index : i32,\n"
" level : i32) -> f32",
" coords : vec2<u32>,\n"
" array_index : u32,\n"
" level : u32) -> f32",
TextureKind::kDepth,
ast::TextureDimension::k2dArray,
TextureDataType::kF32,
"textureLoad",
[](ProgramBuilder* b) {
return b->ExprList("texture", // t
b->vec2<i32>(1_i, 2_i), // coords
3_i, // array_index
4_i); // level
b->vec2<u32>(1_u, 2_u), // coords
3_u, // array_index
4_u); // level
},
},
{
@@ -2216,8 +2216,8 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
{
ValidTextureOverload::kStoreWO2dArrayRgba32float,
"textureStore(t : texture_storage_2d_array<rgba32float>,\n"
" coords : vec2<i32>,\n"
" array_index : i32,\n"
" coords : vec2<u32>,\n"
" array_index : u32,\n"
" value : vec4<T>)",
ast::Access::kWrite,
ast::TexelFormat::kRgba32Float,
@@ -2226,15 +2226,15 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
"textureStore",
[](ProgramBuilder* b) {
return b->ExprList("texture", // t
b->vec2<i32>(1_i, 2_i), // coords
3_i, // array_index
b->vec2<u32>(1_u, 2_u), // coords
3_u, // array_index
b->vec4<f32>(4_f, 5_f, 6_f, 7_f)); // value
},
},
{
ValidTextureOverload::kStoreWO3dRgba32float,
"textureStore(t : texture_storage_3d<rgba32float>,\n"
" coords : vec3<i32>,\n"
" coords : vec3<u32>,\n"
" value : vec4<T>)",
ast::Access::kWrite,
ast::TexelFormat::kRgba32Float,
@@ -2243,7 +2243,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
"textureStore",
[](ProgramBuilder* b) {
return b->ExprList("texture", // t
b->vec3<i32>(1_i, 2_i, 3_i), // coords
b->vec3<u32>(1_u, 2_u, 3_u), // coords
b->vec4<f32>(4_f, 5_f, 6_f, 7_f)); // value
},
},