From 955cc65a400204e258d7ac6ef096cc113a035bf3 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Mon, 11 Dec 2023 17:28:04 -0800 Subject: [PATCH] [naga wgsl-out] Include the `i` suffix on `i32` literals. Without the suffix, `Expression::Literal(Literal::I32)` expressions get written without any suffix on the decimal number, meaning that they get re-parsed as AbstractInt values. In theory, this should always be fine, but since we don't actually support abstract types yet in all the places we should, having them appear in the output causes validation problems. --- CHANGELOG.md | 2 + naga/src/back/wgsl/writer.rs | 2 +- .../wgsl/900-implicit-conversions.frag.wgsl | 2 +- .../out/wgsl/931-constant-emitting.frag.wgsl | 2 +- naga/tests/out/wgsl/932-for-loop-if.frag.wgsl | 6 +- naga/tests/out/wgsl/abstract-types-const.wgsl | 20 +-- naga/tests/out/wgsl/abstract-types-var.wgsl | 28 ++-- naga/tests/out/wgsl/access.wgsl | 20 +-- naga/tests/out/wgsl/atomicOps.wgsl | 72 ++++----- naga/tests/out/wgsl/bevy-pbr.frag.wgsl | 12 +- .../out/wgsl/binding-arrays.dynamic.wgsl | 2 +- .../tests/out/wgsl/binding-arrays.static.wgsl | 2 +- naga/tests/out/wgsl/binding-arrays.wgsl | 8 +- naga/tests/out/wgsl/bitcast.wgsl | 6 +- naga/tests/out/wgsl/bits.wgsl | 8 +- naga/tests/out/wgsl/bits_glsl.frag.wgsl | 8 +- naga/tests/out/wgsl/boids.wgsl | 12 +- naga/tests/out/wgsl/buffer.frag.wgsl | 2 +- naga/tests/out/wgsl/const-exprs.wgsl | 30 ++-- .../out/wgsl/constant-array-size.frag.wgsl | 6 +- naga/tests/out/wgsl/constructors.wgsl | 6 +- naga/tests/out/wgsl/control-flow.wgsl | 24 +-- naga/tests/out/wgsl/declarations.frag.wgsl | 2 +- .../out/wgsl/double-math-functions.frag.wgsl | 2 +- naga/tests/out/wgsl/empty-global-name.wgsl | 2 +- naga/tests/out/wgsl/expressions.frag.wgsl | 4 +- naga/tests/out/wgsl/fragment-output.wgsl | 8 +- naga/tests/out/wgsl/functions.wgsl | 6 +- naga/tests/out/wgsl/globals.wgsl | 2 +- naga/tests/out/wgsl/image.wgsl | 58 +++---- naga/tests/out/wgsl/lexical-scopes.wgsl | 10 +- .../out/wgsl/local-var-init-in-loop.comp.wgsl | 6 +- naga/tests/out/wgsl/math-functions.frag.wgsl | 2 +- naga/tests/out/wgsl/math-functions.wgsl | 28 ++-- naga/tests/out/wgsl/module-scope.wgsl | 4 +- naga/tests/out/wgsl/operators.wgsl | 142 +++++++++--------- naga/tests/out/wgsl/pointers.wgsl | 2 +- naga/tests/out/wgsl/prepostfix.frag.wgsl | 6 +- naga/tests/out/wgsl/samplers.frag.wgsl | 142 +++++++++--------- naga/tests/out/wgsl/skybox.wgsl | 4 +- .../out/wgsl/workgroup-uniform-load.wgsl | 2 +- 41 files changed, 357 insertions(+), 355 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c33eef76b..dd4f5f388e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -155,6 +155,8 @@ Passing an owned value `window` to `Surface` will return a `Surface<'static>`. S - Emit and init `struct` member padding always. By @ErichDonGubler in [#4701](https://github.com/gfx-rs/wgpu/pull/4701). +- In WGSL output, always include the `i` suffix on `i32` literals. By @jimblandy in [#4863](https://github.com/gfx-rs/wgpu/pull/4863). + ### Bug Fixes #### General diff --git a/naga/src/back/wgsl/writer.rs b/naga/src/back/wgsl/writer.rs index a356c7e2ad..28faaf6690 100644 --- a/naga/src/back/wgsl/writer.rs +++ b/naga/src/back/wgsl/writer.rs @@ -1093,7 +1093,7 @@ impl Writer { // decimal part even it's zero crate::Literal::F32(value) => write!(self.out, "{:?}", value)?, crate::Literal::U32(value) => write!(self.out, "{}u", value)?, - crate::Literal::I32(value) => write!(self.out, "{}", value)?, + crate::Literal::I32(value) => write!(self.out, "{}i", value)?, crate::Literal::Bool(value) => write!(self.out, "{}", value)?, crate::Literal::F64(value) => write!(self.out, "{:?}lf", value)?, crate::Literal::I64(_) => { diff --git a/naga/tests/out/wgsl/900-implicit-conversions.frag.wgsl b/naga/tests/out/wgsl/900-implicit-conversions.frag.wgsl index 9f8620fdda..8a6c9851fa 100644 --- a/naga/tests/out/wgsl/900-implicit-conversions.frag.wgsl +++ b/naga/tests/out/wgsl/900-implicit-conversions.frag.wgsl @@ -55,7 +55,7 @@ fn implicit_dims_3(v_6: vec4) { } fn main_1() { - exact_1(1); + exact_1(1i); implicit(1.0); implicit_dims_2(vec3(1.0)); return; diff --git a/naga/tests/out/wgsl/931-constant-emitting.frag.wgsl b/naga/tests/out/wgsl/931-constant-emitting.frag.wgsl index ba5d223ef7..5ec5a77b1e 100644 --- a/naga/tests/out/wgsl/931-constant-emitting.frag.wgsl +++ b/naga/tests/out/wgsl/931-constant-emitting.frag.wgsl @@ -1,4 +1,4 @@ -const constant: i32 = 10; +const constant: i32 = 10i; fn function() -> f32 { return 0.0; diff --git a/naga/tests/out/wgsl/932-for-loop-if.frag.wgsl b/naga/tests/out/wgsl/932-for-loop-if.frag.wgsl index ad1fdd34ee..bf6a281b49 100644 --- a/naga/tests/out/wgsl/932-for-loop-if.frag.wgsl +++ b/naga/tests/out/wgsl/932-for-loop-if.frag.wgsl @@ -1,16 +1,16 @@ fn main_1() { - var i: i32 = 0; + var i: i32 = 0i; loop { let _e2 = i; - if !((_e2 < 1)) { + if !((_e2 < 1i)) { break; } { } continuing { let _e6 = i; - i = (_e6 + 1); + i = (_e6 + 1i); } } return; diff --git a/naga/tests/out/wgsl/abstract-types-const.wgsl b/naga/tests/out/wgsl/abstract-types-const.wgsl index 538be44df7..90ee197fb5 100644 --- a/naga/tests/out/wgsl/abstract-types-const.wgsl +++ b/naga/tests/out/wgsl/abstract-types-const.wgsl @@ -18,9 +18,9 @@ const xmfpaiaiaiaf: mat2x2 = mat2x2(vec2(1.0, 2.0), vec2(3.0 const imfpaiaiaiai: mat2x2 = mat2x2(vec2(1.0, 2.0), vec2(3.0, 4.0)); const imfpafaiaiai: mat2x2 = mat2x2(vec2(1.0, 2.0), vec2(3.0, 4.0)); const imfpafafafaf: mat2x2 = mat2x2(vec2(1.0, 2.0), vec2(3.0, 4.0)); -const ivispai: vec2 = vec2(1); +const ivispai: vec2 = vec2(1i); const ivfspaf: vec2 = vec2(1.0); -const ivis_ai: vec2 = vec2(1); +const ivis_ai: vec2 = vec2(1i); const ivus_ai: vec2 = vec2(1u); const ivfs_ai: vec2 = vec2(1.0); const ivfs_af: vec2 = vec2(1.0); @@ -30,14 +30,14 @@ const iafpafaf: array = array(1.0, 2.0); const iafpaiaf: array = array(1.0, 2.0); const iafpafai: array = array(1.0, 2.0); const xafpafaf: array = array(1.0, 2.0); -const s_f_i_u: S = S(1.0, 1, 1u); -const s_f_iai: S = S(1.0, 1, 1u); -const s_fai_u: S = S(1.0, 1, 1u); -const s_faiai: S = S(1.0, 1, 1u); -const saf_i_u: S = S(1.0, 1, 1u); -const saf_iai: S = S(1.0, 1, 1u); -const safai_u: S = S(1.0, 1, 1u); -const safaiai: S = S(1.0, 1, 1u); +const s_f_i_u: S = S(1.0, 1i, 1u); +const s_f_iai: S = S(1.0, 1i, 1u); +const s_fai_u: S = S(1.0, 1i, 1u); +const s_faiai: S = S(1.0, 1i, 1u); +const saf_i_u: S = S(1.0, 1i, 1u); +const saf_iai: S = S(1.0, 1i, 1u); +const safai_u: S = S(1.0, 1i, 1u); +const safaiai: S = S(1.0, 1i, 1u); const ivfr_f_f: vec3 = vec3(vec2(1.0, 2.0), 3.0); const ivfr_f_af: vec3 = vec3(vec2(1.0, 2.0), 3.0); const ivfraf_f: vec3 = vec3(vec2(1.0, 2.0), 3.0); diff --git a/naga/tests/out/wgsl/abstract-types-var.wgsl b/naga/tests/out/wgsl/abstract-types-var.wgsl index ae95ff2e82..1229261d9d 100644 --- a/naga/tests/out/wgsl/abstract-types-var.wgsl +++ b/naga/tests/out/wgsl/abstract-types-var.wgsl @@ -1,4 +1,4 @@ -var xvipaiai_1: vec2 = vec2(42, 43); +var xvipaiai_1: vec2 = vec2(42i, 43i); var xvupaiai_1: vec2 = vec2(44u, 45u); var xvfpaiai_1: vec2 = vec2(46.0, 47.0); var xvupuai_2: vec2 = vec2(42u, 43u); @@ -10,21 +10,21 @@ var xmfpafaiaiai_1: mat2x2 = mat2x2(vec2(1.0, 2.0), vec2 var xmfpaiafaiai_1: mat2x2 = mat2x2(vec2(1.0, 2.0), vec2(3.0, 4.0)); var xmfpaiaiafai_1: mat2x2 = mat2x2(vec2(1.0, 2.0), vec2(3.0, 4.0)); var xmfpaiaiaiaf_1: mat2x2 = mat2x2(vec2(1.0, 2.0), vec2(3.0, 4.0)); -var xvispai_1: vec2 = vec2(1); +var xvispai_1: vec2 = vec2(1i); var xvfspaf_1: vec2 = vec2(1.0); -var xvis_ai_1: vec2 = vec2(1); +var xvis_ai_1: vec2 = vec2(1i); var xvus_ai_1: vec2 = vec2(1u); var xvfs_ai_1: vec2 = vec2(1.0); var xvfs_af_1: vec2 = vec2(1.0); var xafafaf_1: array = array(1.0, 2.0); var xafaiai_1: array = array(1.0, 2.0); -var xafpaiai_1: array = array(1, 2); +var xafpaiai_1: array = array(1i, 2i); var xafpaiaf_1: array = array(1.0, 2.0); var xafpafai_1: array = array(1.0, 2.0); var xafpafaf_1: array = array(1.0, 2.0); fn all_constant_arguments() { - var xvipaiai: vec2 = vec2(42, 43); + var xvipaiai: vec2 = vec2(42i, 43i); var xvupaiai: vec2 = vec2(44u, 45u); var xvfpaiai: vec2 = vec2(46.0, 47.0); var xvupuai: vec2 = vec2(42u, 43u); @@ -40,9 +40,9 @@ fn all_constant_arguments() { var xmfpai_faiai: mat2x2 = mat2x2(vec2(1.0, 2.0), vec2(3.0, 4.0)); var xmfpaiai_fai: mat2x2 = mat2x2(vec2(1.0, 2.0), vec2(3.0, 4.0)); var xmfpaiaiai_f: mat2x2 = mat2x2(vec2(1.0, 2.0), vec2(3.0, 4.0)); - var xvispai: vec2 = vec2(1); + var xvispai: vec2 = vec2(1i); var xvfspaf: vec2 = vec2(1.0); - var xvis_ai: vec2 = vec2(1); + var xvis_ai: vec2 = vec2(1i); var xvus_ai: vec2 = vec2(1u); var xvfs_ai: vec2 = vec2(1.0); var xvfs_af: vec2 = vec2(1.0); @@ -50,9 +50,9 @@ fn all_constant_arguments() { var xaf_faf: array = array(1.0, 2.0); var xafaf_f: array = array(1.0, 2.0); var xafaiai: array = array(1.0, 2.0); - var xai_iai: array = array(1, 2); - var xaiai_i: array = array(1, 2); - var xaipaiai: array = array(1, 2); + var xai_iai: array = array(1i, 2i); + var xaiai_i: array = array(1i, 2i); + var xaipaiai: array = array(1i, 2i); var xafpaiai: array = array(1.0, 2.0); var xafpaiaf: array = array(1.0, 2.0); var xafpafai: array = array(1.0, 2.0); @@ -110,9 +110,9 @@ fn mixed_constant_and_runtime_arguments() { let _e63 = f; xafai_f = array(1.0, _e63); let _e67 = i; - xai_iai_1 = array(_e67, 2); + xai_iai_1 = array(_e67, 2i); let _e71 = i; - xaiai_i_1 = array(1, _e71); + xaiai_i_1 = array(1i, _e71); let _e75 = f; xafp_faf = array(_e75, 2.0); let _e79 = f; @@ -122,9 +122,9 @@ fn mixed_constant_and_runtime_arguments() { let _e87 = f; xafpai_f = array(1.0, _e87); let _e91 = i; - xaip_iai = array(_e91, 2); + xaip_iai = array(_e91, 2i); let _e95 = i; - xaipai_i = array(1, _e95); + xaipai_i = array(1i, _e95); return; } diff --git a/naga/tests/out/wgsl/access.wgsl b/naga/tests/out/wgsl/access.wgsl index e6904bd62d..eb89d3a1cb 100644 --- a/naga/tests/out/wgsl/access.wgsl +++ b/naga/tests/out/wgsl/access.wgsl @@ -25,7 +25,7 @@ struct MatCx2InArray { am: array, 2>, } -var global_const: GlobalConst = GlobalConst(0u, vec3(0u, 0u, 0u), 0); +var global_const: GlobalConst = GlobalConst(0u, vec3(0u, 0u, 0u), 0i); @group(0) @binding(0) var bar: Bar; @group(0) @binding(1) @@ -36,11 +36,11 @@ var qux: vec2; var nested_mat_cx2_: MatCx2InArray; fn test_matrix_within_struct_accesses() { - var idx: i32 = 1; + var idx: i32 = 1i; var t: Baz = Baz(mat3x2(vec2(1.0), vec2(2.0), vec2(3.0))); let _e3 = idx; - idx = (_e3 - 1); + idx = (_e3 - 1i); let l0_ = baz.m; let l1_ = baz.m[0]; let _e14 = idx; @@ -54,7 +54,7 @@ fn test_matrix_within_struct_accesses() { let _e38 = idx; let l6_ = baz.m[_e36][_e38]; let _e51 = idx; - idx = (_e51 + 1); + idx = (_e51 + 1i); t.m = mat3x2(vec2(6.0), vec2(5.0), vec2(4.0)); t.m[0] = vec2(9.0); let _e66 = idx; @@ -71,11 +71,11 @@ fn test_matrix_within_struct_accesses() { } fn test_matrix_within_array_within_struct_accesses() { - var idx_1: i32 = 1; + var idx_1: i32 = 1i; var t_1: MatCx2InArray = MatCx2InArray(array, 2>()); let _e3 = idx_1; - idx_1 = (_e3 - 1); + idx_1 = (_e3 - 1i); let l0_1 = nested_mat_cx2_.am; let l1_1 = nested_mat_cx2_.am[0]; let l2_1 = nested_mat_cx2_.am[0][0]; @@ -90,7 +90,7 @@ fn test_matrix_within_array_within_struct_accesses() { let _e48 = idx_1; let l7_ = nested_mat_cx2_.am[0][_e46][_e48]; let _e55 = idx_1; - idx_1 = (_e55 + 1); + idx_1 = (_e55 + 1i); t_1.am = array, 2>(); t_1.am[0] = mat4x2(vec2(8.0), vec2(7.0), vec2(6.0), vec2(5.0)); t_1.am[0][0] = vec2(9.0); @@ -142,8 +142,8 @@ fn foo_vert(@builtin(vertex_index) vi: u32) -> @builtin(position) vec4 { let c = qux; let data_pointer = (&bar.data[0].value); let _e33 = read_from_private((&foo)); - c2_ = array(a_1, i32(b), 3, 4, 5); - c2_[(vi + 1u)] = 42; + c2_ = array(a_1, i32(b), 3i, 4i, 5i); + c2_[(vi + 1u)] = 42i; let value = c2_[vi]; let _e47 = test_arr_as_arg(array, 5>()); return vec4((_matrix * vec4(vec4(value))), 2.0); @@ -154,7 +154,7 @@ fn foo_frag() -> @location(0) vec4 { bar._matrix[1][2] = 1.0; bar._matrix = mat4x3(vec3(0.0), vec3(1.0), vec3(2.0), vec3(3.0)); bar.arr = array, 2>(vec2(0u), vec2(1u)); - bar.data[1].value = 1; + bar.data[1].value = 1i; qux = vec2(); return vec4(0.0); } diff --git a/naga/tests/out/wgsl/atomicOps.wgsl b/naga/tests/out/wgsl/atomicOps.wgsl index dcffe38e14..be102e6833 100644 --- a/naga/tests/out/wgsl/atomicOps.wgsl +++ b/naga/tests/out/wgsl/atomicOps.wgsl @@ -16,13 +16,13 @@ var workgroup_struct: Struct; @compute @workgroup_size(2, 1, 1) fn cs_main(@builtin(local_invocation_id) id: vec3) { atomicStore((&storage_atomic_scalar), 1u); - atomicStore((&storage_atomic_arr[1]), 1); + atomicStore((&storage_atomic_arr[1]), 1i); atomicStore((&storage_struct.atomic_scalar), 1u); - atomicStore((&storage_struct.atomic_arr[1]), 1); + atomicStore((&storage_struct.atomic_arr[1]), 1i); atomicStore((&workgroup_atomic_scalar), 1u); - atomicStore((&workgroup_atomic_arr[1]), 1); + atomicStore((&workgroup_atomic_arr[1]), 1i); atomicStore((&workgroup_struct.atomic_scalar), 1u); - atomicStore((&workgroup_struct.atomic_arr[1]), 1); + atomicStore((&workgroup_struct.atomic_arr[1]), 1i); workgroupBarrier(); let l0_ = atomicLoad((&storage_atomic_scalar)); let l1_ = atomicLoad((&storage_atomic_arr[1])); @@ -34,74 +34,74 @@ fn cs_main(@builtin(local_invocation_id) id: vec3) { let l7_ = atomicLoad((&workgroup_struct.atomic_arr[1])); workgroupBarrier(); let _e51 = atomicAdd((&storage_atomic_scalar), 1u); - let _e55 = atomicAdd((&storage_atomic_arr[1]), 1); + let _e55 = atomicAdd((&storage_atomic_arr[1]), 1i); let _e59 = atomicAdd((&storage_struct.atomic_scalar), 1u); - let _e64 = atomicAdd((&storage_struct.atomic_arr[1]), 1); + let _e64 = atomicAdd((&storage_struct.atomic_arr[1]), 1i); let _e67 = atomicAdd((&workgroup_atomic_scalar), 1u); - let _e71 = atomicAdd((&workgroup_atomic_arr[1]), 1); + let _e71 = atomicAdd((&workgroup_atomic_arr[1]), 1i); let _e75 = atomicAdd((&workgroup_struct.atomic_scalar), 1u); - let _e80 = atomicAdd((&workgroup_struct.atomic_arr[1]), 1); + let _e80 = atomicAdd((&workgroup_struct.atomic_arr[1]), 1i); workgroupBarrier(); let _e83 = atomicSub((&storage_atomic_scalar), 1u); - let _e87 = atomicSub((&storage_atomic_arr[1]), 1); + let _e87 = atomicSub((&storage_atomic_arr[1]), 1i); let _e91 = atomicSub((&storage_struct.atomic_scalar), 1u); - let _e96 = atomicSub((&storage_struct.atomic_arr[1]), 1); + let _e96 = atomicSub((&storage_struct.atomic_arr[1]), 1i); let _e99 = atomicSub((&workgroup_atomic_scalar), 1u); - let _e103 = atomicSub((&workgroup_atomic_arr[1]), 1); + let _e103 = atomicSub((&workgroup_atomic_arr[1]), 1i); let _e107 = atomicSub((&workgroup_struct.atomic_scalar), 1u); - let _e112 = atomicSub((&workgroup_struct.atomic_arr[1]), 1); + let _e112 = atomicSub((&workgroup_struct.atomic_arr[1]), 1i); workgroupBarrier(); let _e115 = atomicMax((&storage_atomic_scalar), 1u); - let _e119 = atomicMax((&storage_atomic_arr[1]), 1); + let _e119 = atomicMax((&storage_atomic_arr[1]), 1i); let _e123 = atomicMax((&storage_struct.atomic_scalar), 1u); - let _e128 = atomicMax((&storage_struct.atomic_arr[1]), 1); + let _e128 = atomicMax((&storage_struct.atomic_arr[1]), 1i); let _e131 = atomicMax((&workgroup_atomic_scalar), 1u); - let _e135 = atomicMax((&workgroup_atomic_arr[1]), 1); + let _e135 = atomicMax((&workgroup_atomic_arr[1]), 1i); let _e139 = atomicMax((&workgroup_struct.atomic_scalar), 1u); - let _e144 = atomicMax((&workgroup_struct.atomic_arr[1]), 1); + let _e144 = atomicMax((&workgroup_struct.atomic_arr[1]), 1i); workgroupBarrier(); let _e147 = atomicMin((&storage_atomic_scalar), 1u); - let _e151 = atomicMin((&storage_atomic_arr[1]), 1); + let _e151 = atomicMin((&storage_atomic_arr[1]), 1i); let _e155 = atomicMin((&storage_struct.atomic_scalar), 1u); - let _e160 = atomicMin((&storage_struct.atomic_arr[1]), 1); + let _e160 = atomicMin((&storage_struct.atomic_arr[1]), 1i); let _e163 = atomicMin((&workgroup_atomic_scalar), 1u); - let _e167 = atomicMin((&workgroup_atomic_arr[1]), 1); + let _e167 = atomicMin((&workgroup_atomic_arr[1]), 1i); let _e171 = atomicMin((&workgroup_struct.atomic_scalar), 1u); - let _e176 = atomicMin((&workgroup_struct.atomic_arr[1]), 1); + let _e176 = atomicMin((&workgroup_struct.atomic_arr[1]), 1i); workgroupBarrier(); let _e179 = atomicAnd((&storage_atomic_scalar), 1u); - let _e183 = atomicAnd((&storage_atomic_arr[1]), 1); + let _e183 = atomicAnd((&storage_atomic_arr[1]), 1i); let _e187 = atomicAnd((&storage_struct.atomic_scalar), 1u); - let _e192 = atomicAnd((&storage_struct.atomic_arr[1]), 1); + let _e192 = atomicAnd((&storage_struct.atomic_arr[1]), 1i); let _e195 = atomicAnd((&workgroup_atomic_scalar), 1u); - let _e199 = atomicAnd((&workgroup_atomic_arr[1]), 1); + let _e199 = atomicAnd((&workgroup_atomic_arr[1]), 1i); let _e203 = atomicAnd((&workgroup_struct.atomic_scalar), 1u); - let _e208 = atomicAnd((&workgroup_struct.atomic_arr[1]), 1); + let _e208 = atomicAnd((&workgroup_struct.atomic_arr[1]), 1i); workgroupBarrier(); let _e211 = atomicOr((&storage_atomic_scalar), 1u); - let _e215 = atomicOr((&storage_atomic_arr[1]), 1); + let _e215 = atomicOr((&storage_atomic_arr[1]), 1i); let _e219 = atomicOr((&storage_struct.atomic_scalar), 1u); - let _e224 = atomicOr((&storage_struct.atomic_arr[1]), 1); + let _e224 = atomicOr((&storage_struct.atomic_arr[1]), 1i); let _e227 = atomicOr((&workgroup_atomic_scalar), 1u); - let _e231 = atomicOr((&workgroup_atomic_arr[1]), 1); + let _e231 = atomicOr((&workgroup_atomic_arr[1]), 1i); let _e235 = atomicOr((&workgroup_struct.atomic_scalar), 1u); - let _e240 = atomicOr((&workgroup_struct.atomic_arr[1]), 1); + let _e240 = atomicOr((&workgroup_struct.atomic_arr[1]), 1i); workgroupBarrier(); let _e243 = atomicXor((&storage_atomic_scalar), 1u); - let _e247 = atomicXor((&storage_atomic_arr[1]), 1); + let _e247 = atomicXor((&storage_atomic_arr[1]), 1i); let _e251 = atomicXor((&storage_struct.atomic_scalar), 1u); - let _e256 = atomicXor((&storage_struct.atomic_arr[1]), 1); + let _e256 = atomicXor((&storage_struct.atomic_arr[1]), 1i); let _e259 = atomicXor((&workgroup_atomic_scalar), 1u); - let _e263 = atomicXor((&workgroup_atomic_arr[1]), 1); + let _e263 = atomicXor((&workgroup_atomic_arr[1]), 1i); let _e267 = atomicXor((&workgroup_struct.atomic_scalar), 1u); - let _e272 = atomicXor((&workgroup_struct.atomic_arr[1]), 1); + let _e272 = atomicXor((&workgroup_struct.atomic_arr[1]), 1i); let _e275 = atomicExchange((&storage_atomic_scalar), 1u); - let _e279 = atomicExchange((&storage_atomic_arr[1]), 1); + let _e279 = atomicExchange((&storage_atomic_arr[1]), 1i); let _e283 = atomicExchange((&storage_struct.atomic_scalar), 1u); - let _e288 = atomicExchange((&storage_struct.atomic_arr[1]), 1); + let _e288 = atomicExchange((&storage_struct.atomic_arr[1]), 1i); let _e291 = atomicExchange((&workgroup_atomic_scalar), 1u); - let _e295 = atomicExchange((&workgroup_atomic_arr[1]), 1); + let _e295 = atomicExchange((&workgroup_atomic_arr[1]), 1i); let _e299 = atomicExchange((&workgroup_struct.atomic_scalar), 1u); - let _e304 = atomicExchange((&workgroup_struct.atomic_arr[1]), 1); + let _e304 = atomicExchange((&workgroup_struct.atomic_arr[1]), 1i); return; } diff --git a/naga/tests/out/wgsl/bevy-pbr.frag.wgsl b/naga/tests/out/wgsl/bevy-pbr.frag.wgsl index c40b6dd73d..f2c3710ee7 100644 --- a/naga/tests/out/wgsl/bevy-pbr.frag.wgsl +++ b/naga/tests/out/wgsl/bevy-pbr.frag.wgsl @@ -48,8 +48,8 @@ struct FragmentOutput { @location(0) o_Target: vec4, } -const MAX_POINT_LIGHTS: i32 = 10; -const MAX_DIRECTIONAL_LIGHTS: i32 = 1; +const MAX_POINT_LIGHTS: i32 = 10i; +const MAX_DIRECTIONAL_LIGHTS: i32 = 1i; const PI: f32 = 3.1415927; var v_WorldPosition_1: vec3; @@ -714,8 +714,8 @@ fn main_1() { var diffuseColor_4: vec3; var R_4: vec3; var light_accum: vec3 = vec3(0.0); - var i: i32 = 0; - var i_1: i32 = 0; + var i: i32 = 0i; + var i_1: i32 = 0i; var diffuse_ambient: vec3; var specular_ambient: vec3; @@ -846,7 +846,7 @@ fn main_1() { } continuing { let _e236 = i; - i = (_e236 + 1); + i = (_e236 + 1i); } } loop { @@ -873,7 +873,7 @@ fn main_1() { } continuing { let _e273 = i_1; - i_1 = (_e273 + 1); + i_1 = (_e273 + 1i); } } let _e302 = diffuseColor_4; diff --git a/naga/tests/out/wgsl/binding-arrays.dynamic.wgsl b/naga/tests/out/wgsl/binding-arrays.dynamic.wgsl index 3a3b116643..e429fbeecb 100644 --- a/naga/tests/out/wgsl/binding-arrays.dynamic.wgsl +++ b/naga/tests/out/wgsl/binding-arrays.dynamic.wgsl @@ -5,7 +5,7 @@ var global_1: binding_array; var global_2: vec4; fn function() { - let _e8 = textureSampleLevel(global[1], global_1[1], vec2(0.5, 0.5), 0.0); + let _e8 = textureSampleLevel(global[1i], global_1[1i], vec2(0.5, 0.5), 0.0); global_2 = _e8; return; } diff --git a/naga/tests/out/wgsl/binding-arrays.static.wgsl b/naga/tests/out/wgsl/binding-arrays.static.wgsl index ff969359f0..09376b4be7 100644 --- a/naga/tests/out/wgsl/binding-arrays.static.wgsl +++ b/naga/tests/out/wgsl/binding-arrays.static.wgsl @@ -5,7 +5,7 @@ var global_1: binding_array; var global_2: vec4; fn function() { - let _e8 = textureSampleLevel(global[1], global_1[1], vec2(0.5, 0.5), 0.0); + let _e8 = textureSampleLevel(global[1i], global_1[1i], vec2(0.5, 0.5), 0.0); global_2 = _e8; return; } diff --git a/naga/tests/out/wgsl/binding-arrays.wgsl b/naga/tests/out/wgsl/binding-arrays.wgsl index c7a01fc5c3..43f2d7ded4 100644 --- a/naga/tests/out/wgsl/binding-arrays.wgsl +++ b/naga/tests/out/wgsl/binding-arrays.wgsl @@ -35,7 +35,7 @@ fn main(fragment_in: FragmentIn) -> @location(0) vec4 { let uniform_index = uni.index; let non_uniform_index = fragment_in.index; let uv = vec2(0.0); - let pix = vec2(0); + let pix = vec2(0i); let _e21 = textureDimensions(texture_array_unbounded[0]); let _e22 = u2_; u2_ = (_e22 + _e21); @@ -63,13 +63,13 @@ fn main(fragment_in: FragmentIn) -> @location(0) vec4 { let _e76 = textureGatherCompare(texture_array_depth[non_uniform_index], samp_comp[non_uniform_index], uv, 0.0); let _e77 = v4_; v4_ = (_e77 + _e76); - let _e82 = textureLoad(texture_array_unbounded[0], pix, 0); + let _e82 = textureLoad(texture_array_unbounded[0], pix, 0i); let _e83 = v4_; v4_ = (_e83 + _e82); - let _e88 = textureLoad(texture_array_unbounded[uniform_index], pix, 0); + let _e88 = textureLoad(texture_array_unbounded[uniform_index], pix, 0i); let _e89 = v4_; v4_ = (_e89 + _e88); - let _e94 = textureLoad(texture_array_unbounded[non_uniform_index], pix, 0); + let _e94 = textureLoad(texture_array_unbounded[non_uniform_index], pix, 0i); let _e95 = v4_; v4_ = (_e95 + _e94); let _e99 = textureNumLayers(texture_array_2darray[0]); diff --git a/naga/tests/out/wgsl/bitcast.wgsl b/naga/tests/out/wgsl/bitcast.wgsl index a426c26ca0..e0ce18ed75 100644 --- a/naga/tests/out/wgsl/bitcast.wgsl +++ b/naga/tests/out/wgsl/bitcast.wgsl @@ -1,8 +1,8 @@ @compute @workgroup_size(1, 1, 1) fn main() { - var i2_: vec2 = vec2(0); - var i3_: vec3 = vec3(0); - var i4_: vec4 = vec4(0); + var i2_: vec2 = vec2(0i); + var i3_: vec3 = vec3(0i); + var i4_: vec4 = vec4(0i); var u2_: vec2 = vec2(0u); var u3_: vec3 = vec3(0u); var u4_: vec4 = vec4(0u); diff --git a/naga/tests/out/wgsl/bits.wgsl b/naga/tests/out/wgsl/bits.wgsl index fb4f396a52..afe99fe246 100644 --- a/naga/tests/out/wgsl/bits.wgsl +++ b/naga/tests/out/wgsl/bits.wgsl @@ -1,9 +1,9 @@ @compute @workgroup_size(1, 1, 1) fn main() { - var i: i32 = 0; - var i2_: vec2 = vec2(0); - var i3_: vec3 = vec3(0); - var i4_: vec4 = vec4(0); + var i: i32 = 0i; + var i2_: vec2 = vec2(0i); + var i3_: vec3 = vec3(0i); + var i4_: vec4 = vec4(0i); var u: u32 = 0u; var u2_: vec2 = vec2(0u); var u3_: vec3 = vec3(0u); diff --git a/naga/tests/out/wgsl/bits_glsl.frag.wgsl b/naga/tests/out/wgsl/bits_glsl.frag.wgsl index 597d5aa1c5..c3535c95b1 100644 --- a/naga/tests/out/wgsl/bits_glsl.frag.wgsl +++ b/naga/tests/out/wgsl/bits_glsl.frag.wgsl @@ -1,8 +1,8 @@ fn main_1() { - var i: i32 = 0; - var i2_: vec2 = vec2(0); - var i3_: vec3 = vec3(0); - var i4_: vec4 = vec4(0); + var i: i32 = 0i; + var i2_: vec2 = vec2(0i); + var i3_: vec3 = vec3(0i); + var i4_: vec4 = vec4(0i); var u: u32 = 0u; var u2_: vec2 = vec2(0u); var u3_: vec3 = vec3(0u); diff --git a/naga/tests/out/wgsl/boids.wgsl b/naga/tests/out/wgsl/boids.wgsl index b87d3ed91d..017d701a5c 100644 --- a/naga/tests/out/wgsl/boids.wgsl +++ b/naga/tests/out/wgsl/boids.wgsl @@ -33,8 +33,8 @@ fn main(@builtin(global_invocation_id) global_invocation_id: vec3) { var cMass: vec2 = vec2(0.0, 0.0); var cVel: vec2 = vec2(0.0, 0.0); var colVel: vec2 = vec2(0.0, 0.0); - var cMassCount: i32 = 0; - var cVelCount: i32 = 0; + var cMassCount: i32 = 0i; + var cVelCount: i32 = 0i; var pos: vec2; var vel: vec2; var i: u32 = 0u; @@ -70,7 +70,7 @@ fn main(@builtin(global_invocation_id) global_invocation_id: vec3) { let _e61 = pos; cMass = (_e60 + _e61); let _e63 = cMassCount; - cMassCount = (_e63 + 1); + cMassCount = (_e63 + 1i); } let _e66 = pos; let _e67 = vPos; @@ -89,7 +89,7 @@ fn main(@builtin(global_invocation_id) global_invocation_id: vec3) { let _e86 = vel; cVel = (_e85 + _e86); let _e88 = cVelCount; - cVelCount = (_e88 + 1); + cVelCount = (_e88 + 1i); } continuing { let _e91 = i; @@ -97,14 +97,14 @@ fn main(@builtin(global_invocation_id) global_invocation_id: vec3) { } } let _e94 = cMassCount; - if (_e94 > 0) { + if (_e94 > 0i) { let _e97 = cMass; let _e98 = cMassCount; let _e102 = vPos; cMass = ((_e97 / vec2(f32(_e98))) - _e102); } let _e104 = cVelCount; - if (_e104 > 0) { + if (_e104 > 0i) { let _e107 = cVel; let _e108 = cVelCount; cVel = (_e107 / vec2(f32(_e108))); diff --git a/naga/tests/out/wgsl/buffer.frag.wgsl b/naga/tests/out/wgsl/buffer.frag.wgsl index 43bcceb0d5..349d062e74 100644 --- a/naga/tests/out/wgsl/buffer.frag.wgsl +++ b/naga/tests/out/wgsl/buffer.frag.wgsl @@ -17,7 +17,7 @@ fn main_1() { let _e9 = testBuffer.data[0]; a = _e9; - testBuffer.data[1] = 2u; + testBuffer.data[1i] = 2u; let _e19 = testBufferReadOnly.data[0]; b = _e19; return; diff --git a/naga/tests/out/wgsl/const-exprs.wgsl b/naga/tests/out/wgsl/const-exprs.wgsl index 66cf2a745f..313dc4d7b7 100644 --- a/naga/tests/out/wgsl/const-exprs.wgsl +++ b/naga/tests/out/wgsl/const-exprs.wgsl @@ -1,36 +1,36 @@ const TWO: u32 = 2u; -const THREE: i32 = 3; -const FOUR: i32 = 4; -const FOUR_ALIAS: i32 = 4; -const TEST_CONSTANT_ADDITION: i32 = 8; -const TEST_CONSTANT_ALIAS_ADDITION: i32 = 8; +const THREE: i32 = 3i; +const FOUR: i32 = 4i; +const FOUR_ALIAS: i32 = 4i; +const TEST_CONSTANT_ADDITION: i32 = 8i; +const TEST_CONSTANT_ALIAS_ADDITION: i32 = 8i; const PI: f32 = 3.141; const phi_sun: f32 = 6.282; const DIV: vec4 = vec4(0.44444445, 0.0, 0.0, 0.0); -const TEXTURE_KIND_REGULAR: i32 = 0; -const TEXTURE_KIND_WARP: i32 = 1; -const TEXTURE_KIND_SKY: i32 = 2; +const TEXTURE_KIND_REGULAR: i32 = 0i; +const TEXTURE_KIND_WARP: i32 = 1i; +const TEXTURE_KIND_SKY: i32 = 2i; fn swizzle_of_compose() { - var out: vec4 = vec4(4, 3, 2, 1); + var out: vec4 = vec4(4i, 3i, 2i, 1i); } fn index_of_compose() { - var out_1: i32 = 2; + var out_1: i32 = 2i; } fn compose_three_deep() { - var out_2: i32 = 6; + var out_2: i32 = 6i; } fn non_constant_initializers() { - var w: i32 = 30; + var w: i32 = 30i; var x: i32; var y: i32; - var z: i32 = 70; + var z: i32 = 70i; var out_3: vec4; let _e2 = w; @@ -46,12 +46,12 @@ fn non_constant_initializers() { } fn splat_of_constant() { - var out_4: vec4 = vec4(-4, -4, -4, -4); + var out_4: vec4 = vec4(-4i, -4i, -4i, -4i); } fn compose_of_constant() { - var out_5: vec4 = vec4(-4, -4, -4, -4); + var out_5: vec4 = vec4(-4i, -4i, -4i, -4i); } diff --git a/naga/tests/out/wgsl/constant-array-size.frag.wgsl b/naga/tests/out/wgsl/constant-array-size.frag.wgsl index f4baa8c129..08fb0e3ab8 100644 --- a/naga/tests/out/wgsl/constant-array-size.frag.wgsl +++ b/naga/tests/out/wgsl/constant-array-size.frag.wgsl @@ -2,14 +2,14 @@ struct Data { vecs: array, 42>, } -const NUM_VECS: i32 = 42; +const NUM_VECS: i32 = 42i; @group(1) @binding(0) var global: Data; fn function() -> vec4 { var sum: vec4 = vec4(0.0); - var i: i32 = 0; + var i: i32 = 0i; loop { let _e9 = i; @@ -24,7 +24,7 @@ fn function() -> vec4 { } continuing { let _e12 = i; - i = (_e12 + 1); + i = (_e12 + 1i); } } let _e20 = sum; diff --git a/naga/tests/out/wgsl/constructors.wgsl b/naga/tests/out/wgsl/constructors.wgsl index a52fb00217..f482c10a4f 100644 --- a/naga/tests/out/wgsl/constructors.wgsl +++ b/naga/tests/out/wgsl/constructors.wgsl @@ -14,18 +14,18 @@ const cz4_: vec2 = vec2(); const cz5_: mat2x2 = mat2x2(); const cz6_: array = array(); const cz7_: Foo = Foo(); -const cp3_: array = array(0, 1, 2, 3); +const cp3_: array = array(0i, 1i, 2i, 3i); @compute @workgroup_size(1, 1, 1) fn main() { var foo: Foo; - foo = Foo(vec4(1.0), 1); + foo = Foo(vec4(1.0), 1i); let m0_ = mat2x2(vec2(1.0, 0.0), vec2(0.0, 1.0)); let m1_ = mat4x4(vec4(1.0, 0.0, 0.0, 0.0), vec4(0.0, 1.0, 0.0, 0.0), vec4(0.0, 0.0, 1.0, 0.0), vec4(0.0, 0.0, 0.0, 1.0)); let cit0_ = vec2(0u); let cit1_ = mat2x2(vec2(0.0), vec2(0.0)); - let cit2_ = array(0, 1, 2, 3); + let cit2_ = array(0i, 1i, 2i, 3i); let ic0_ = bool(bool()); let ic4_ = vec2(0u, 0u); let ic5_ = mat2x3(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0)); diff --git a/naga/tests/out/wgsl/control-flow.wgsl b/naga/tests/out/wgsl/control-flow.wgsl index 2872406d76..dcc3f90365 100644 --- a/naga/tests/out/wgsl/control-flow.wgsl +++ b/naga/tests/out/wgsl/control-flow.wgsl @@ -7,7 +7,7 @@ fn switch_default_break(i: i32) { } fn switch_case_break() { - switch 0 { + switch 0i { case 0: { break; } @@ -36,28 +36,28 @@ fn main(@builtin(global_invocation_id) global_id: vec3) { storageBarrier(); workgroupBarrier(); - switch 1 { + switch 1i { default: { - pos = 1; + pos = 1i; } } let _e4 = pos; switch _e4 { case 1: { - pos = 0; + pos = 0i; break; } case 2: { - pos = 1; + pos = 1i; } case 3, 4: { - pos = 2; + pos = 2i; } case 5: { - pos = 3; + pos = 3i; } case default, 6: { - pos = 4; + pos = 4i; } } switch 0u { @@ -69,22 +69,22 @@ fn main(@builtin(global_invocation_id) global_id: vec3) { let _e11 = pos; switch _e11 { case 1: { - pos = 0; + pos = 0i; break; } case 2: { - pos = 1; + pos = 1i; return; } case 3: { - pos = 2; + pos = 2i; return; } case 4: { return; } default: { - pos = 3; + pos = 3i; return; } } diff --git a/naga/tests/out/wgsl/declarations.frag.wgsl b/naga/tests/out/wgsl/declarations.frag.wgsl index bfe6da8e2d..32330d19d6 100644 --- a/naga/tests/out/wgsl/declarations.frag.wgsl +++ b/naga/tests/out/wgsl/declarations.frag.wgsl @@ -50,7 +50,7 @@ fn main_1() { a_1 = _e41; let _e57 = array_toomanyd[0][0][0][0][0][0][0]; b = _e57; - out_array[0] = vec4(2.0); + out_array[0i] = vec4(2.0); return; } diff --git a/naga/tests/out/wgsl/double-math-functions.frag.wgsl b/naga/tests/out/wgsl/double-math-functions.frag.wgsl index dfb171eeec..c7ed6a119e 100644 --- a/naga/tests/out/wgsl/double-math-functions.frag.wgsl +++ b/naga/tests/out/wgsl/double-math-functions.frag.wgsl @@ -2,7 +2,7 @@ fn main_1() { var a: vec4 = vec4(1.0lf); var b: vec4 = vec4(2.0lf); var m: mat4x4; - var i: i32 = 5; + var i: i32 = 5i; var ceilOut: vec4; var roundOut: vec4; var floorOut: vec4; diff --git a/naga/tests/out/wgsl/empty-global-name.wgsl b/naga/tests/out/wgsl/empty-global-name.wgsl index 5114003beb..1be54db130 100644 --- a/naga/tests/out/wgsl/empty-global-name.wgsl +++ b/naga/tests/out/wgsl/empty-global-name.wgsl @@ -7,7 +7,7 @@ var unnamed: type_1; fn function() { let _e3 = unnamed.member; - unnamed.member = (_e3 + 1); + unnamed.member = (_e3 + 1i); return; } diff --git a/naga/tests/out/wgsl/expressions.frag.wgsl b/naga/tests/out/wgsl/expressions.frag.wgsl index c3817d8d78..556ec7b009 100644 --- a/naga/tests/out/wgsl/expressions.frag.wgsl +++ b/naga/tests/out/wgsl/expressions.frag.wgsl @@ -280,7 +280,7 @@ fn testUnaryOpMat(a_16: mat3x3) { } fn testStructConstructor() { - var tree: BST = BST(1); + var tree: BST = BST(1i); } @@ -386,7 +386,7 @@ fn testLength() { fn testConstantLength(a_24: array) { var a_25: array; - var len_1: i32 = 4; + var len_1: i32 = 4i; a_25 = a_24; } diff --git a/naga/tests/out/wgsl/fragment-output.wgsl b/naga/tests/out/wgsl/fragment-output.wgsl index f478faa70f..849ee75748 100644 --- a/naga/tests/out/wgsl/fragment-output.wgsl +++ b/naga/tests/out/wgsl/fragment-output.wgsl @@ -21,10 +21,10 @@ fn main_vec4vec3_() -> FragmentOutputVec4Vec3_ { var output: FragmentOutputVec4Vec3_; output.vec4f = vec4(0.0); - output.vec4i = vec4(0); + output.vec4i = vec4(0i); output.vec4u = vec4(0u); output.vec3f = vec3(0.0); - output.vec3i = vec3(0); + output.vec3i = vec3(0i); output.vec3u = vec3(0u); let _e19 = output; return _e19; @@ -35,10 +35,10 @@ fn main_vec2scalar() -> FragmentOutputVec2Scalar { var output_1: FragmentOutputVec2Scalar; output_1.vec2f = vec2(0.0); - output_1.vec2i = vec2(0); + output_1.vec2i = vec2(0i); output_1.vec2u = vec2(0u); output_1.scalarf = 0.0; - output_1.scalari = 0; + output_1.scalari = 0i; output_1.scalaru = 0u; let _e16 = output_1; return _e16; diff --git a/naga/tests/out/wgsl/functions.wgsl b/naga/tests/out/wgsl/functions.wgsl index f48a864461..fcaf23d91e 100644 --- a/naga/tests/out/wgsl/functions.wgsl +++ b/naga/tests/out/wgsl/functions.wgsl @@ -6,13 +6,13 @@ fn test_fma() -> vec2 { } fn test_integer_dot_product() -> i32 { - let a_2_ = vec2(1); - let b_2_ = vec2(1); + let a_2_ = vec2(1i); + let b_2_ = vec2(1i); let c_2_ = dot(a_2_, b_2_); let a_3_ = vec3(1u); let b_3_ = vec3(1u); let c_3_ = dot(a_3_, b_3_); - let c_4_ = dot(vec4(4), vec4(2)); + let c_4_ = dot(vec4(4i), vec4(2i)); return c_4_; } diff --git a/naga/tests/out/wgsl/globals.wgsl b/naga/tests/out/wgsl/globals.wgsl index 562533156e..485522c8f5 100644 --- a/naga/tests/out/wgsl/globals.wgsl +++ b/naga/tests/out/wgsl/globals.wgsl @@ -27,7 +27,7 @@ fn test_msl_packed_vec3_as_arg(arg: vec3) { } fn test_msl_packed_vec3_() { - var idx: i32 = 1; + var idx: i32 = 1i; alignment.v3_ = vec3(1.0); alignment.v3_.x = 1.0; diff --git a/naga/tests/out/wgsl/image.wgsl b/naga/tests/out/wgsl/image.wgsl index 062d377139..941b2f4d4d 100644 --- a/naga/tests/out/wgsl/image.wgsl +++ b/naga/tests/out/wgsl/image.wgsl @@ -46,18 +46,18 @@ var image_cube_depth: texture_depth_cube; @compute @workgroup_size(16, 1, 1) fn main(@builtin(local_invocation_id) local_id: vec3) { let dim = textureDimensions(image_storage_src); - let itc = (vec2((dim * local_id.xy)) % vec2(10, 20)); + let itc = (vec2((dim * local_id.xy)) % vec2(10i, 20i)); let value1_ = textureLoad(image_mipmapped_src, itc, i32(local_id.z)); let value2_ = textureLoad(image_multisampled_src, itc, i32(local_id.z)); let value4_ = textureLoad(image_storage_src, itc); - let value5_ = textureLoad(image_array_src, itc, local_id.z, (i32(local_id.z) + 1)); - let value6_ = textureLoad(image_array_src, itc, i32(local_id.z), (i32(local_id.z) + 1)); + let value5_ = textureLoad(image_array_src, itc, local_id.z, (i32(local_id.z) + 1i)); + let value6_ = textureLoad(image_array_src, itc, i32(local_id.z), (i32(local_id.z) + 1i)); let value7_ = textureLoad(image_1d_src, i32(local_id.x), i32(local_id.z)); let value1u = textureLoad(image_mipmapped_src, vec2(itc), i32(local_id.z)); let value2u = textureLoad(image_multisampled_src, vec2(itc), i32(local_id.z)); let value4u = textureLoad(image_storage_src, vec2(itc)); - let value5u = textureLoad(image_array_src, vec2(itc), local_id.z, (i32(local_id.z) + 1)); - let value6u = textureLoad(image_array_src, vec2(itc), i32(local_id.z), (i32(local_id.z) + 1)); + let value5u = textureLoad(image_array_src, vec2(itc), local_id.z, (i32(local_id.z) + 1i)); + let value6u = textureLoad(image_array_src, vec2(itc), i32(local_id.z), (i32(local_id.z) + 1i)); let value7u = textureLoad(image_1d_src, u32(local_id.x), i32(local_id.z)); textureStore(image_dst, itc.x, ((((value1_ + value2_) + value4_) + value5_) + value6_)); textureStore(image_dst, u32(itc.x), ((((value1u + value2u) + value4u) + value5u) + value6u)); @@ -67,7 +67,7 @@ fn main(@builtin(local_invocation_id) local_id: vec3) { @compute @workgroup_size(16, 1, 1) fn depth_load(@builtin(local_invocation_id) local_id_1: vec3) { let dim_1 = textureDimensions(image_storage_src); - let itc_1 = (vec2((dim_1 * local_id_1.xy)) % vec2(10, 20)); + let itc_1 = (vec2((dim_1 * local_id_1.xy)) % vec2(10i, 20i)); let val = textureLoad(image_depth_multisampled_src, itc_1, i32(local_id_1.z)); textureStore(image_dst, itc_1.x, vec4(u32(val))); return; @@ -78,15 +78,15 @@ fn queries() -> @builtin(position) vec4 { let dim_1d = textureDimensions(image_1d); let dim_1d_lod = textureDimensions(image_1d, i32(dim_1d)); let dim_2d = textureDimensions(image_2d); - let dim_2d_lod = textureDimensions(image_2d, 1); + let dim_2d_lod = textureDimensions(image_2d, 1i); let dim_2d_array = textureDimensions(image_2d_array); - let dim_2d_array_lod = textureDimensions(image_2d_array, 1); + let dim_2d_array_lod = textureDimensions(image_2d_array, 1i); let dim_cube = textureDimensions(image_cube); - let dim_cube_lod = textureDimensions(image_cube, 1); + let dim_cube_lod = textureDimensions(image_cube, 1i); let dim_cube_array = textureDimensions(image_cube_array); - let dim_cube_array_lod = textureDimensions(image_cube_array, 1); + let dim_cube_array_lod = textureDimensions(image_cube_array, 1i); let dim_3d = textureDimensions(image_3d); - let dim_3d_lod = textureDimensions(image_3d, 1); + let dim_3d_lod = textureDimensions(image_3d, 1i); let dim_2s_ms = textureDimensions(image_aa); let sum = ((((((((((dim_1d + dim_2d.y) + dim_2d_lod.y) + dim_2d_array.y) + dim_2d_array_lod.y) + dim_cube.y) + dim_cube_lod.y) + dim_cube_array.y) + dim_cube_array_lod.y) + dim_3d.z) + dim_3d_lod.z); return vec4(f32(sum)); @@ -118,46 +118,46 @@ fn texture_sample() -> @location(0) vec4 { let _e14 = textureSample(image_2d, sampler_reg, tc); let _e15 = a; a = (_e15 + _e14); - let _e19 = textureSample(image_2d, sampler_reg, tc, vec2(3, 1)); + let _e19 = textureSample(image_2d, sampler_reg, tc, vec2(3i, 1i)); let _e20 = a; a = (_e20 + _e19); let _e24 = textureSampleLevel(image_2d, sampler_reg, tc, 2.3); let _e25 = a; a = (_e25 + _e24); - let _e29 = textureSampleLevel(image_2d, sampler_reg, tc, 2.3, vec2(3, 1)); + let _e29 = textureSampleLevel(image_2d, sampler_reg, tc, 2.3, vec2(3i, 1i)); let _e30 = a; a = (_e30 + _e29); - let _e35 = textureSampleBias(image_2d, sampler_reg, tc, 2.0, vec2(3, 1)); + let _e35 = textureSampleBias(image_2d, sampler_reg, tc, 2.0, vec2(3i, 1i)); let _e36 = a; a = (_e36 + _e35); let _e41 = textureSample(image_2d_array, sampler_reg, tc, 0u); let _e42 = a; a = (_e42 + _e41); - let _e47 = textureSample(image_2d_array, sampler_reg, tc, 0u, vec2(3, 1)); + let _e47 = textureSample(image_2d_array, sampler_reg, tc, 0u, vec2(3i, 1i)); let _e48 = a; a = (_e48 + _e47); let _e53 = textureSampleLevel(image_2d_array, sampler_reg, tc, 0u, 2.3); let _e54 = a; a = (_e54 + _e53); - let _e59 = textureSampleLevel(image_2d_array, sampler_reg, tc, 0u, 2.3, vec2(3, 1)); + let _e59 = textureSampleLevel(image_2d_array, sampler_reg, tc, 0u, 2.3, vec2(3i, 1i)); let _e60 = a; a = (_e60 + _e59); - let _e66 = textureSampleBias(image_2d_array, sampler_reg, tc, 0u, 2.0, vec2(3, 1)); + let _e66 = textureSampleBias(image_2d_array, sampler_reg, tc, 0u, 2.0, vec2(3i, 1i)); let _e67 = a; a = (_e67 + _e66); - let _e72 = textureSample(image_2d_array, sampler_reg, tc, 0); + let _e72 = textureSample(image_2d_array, sampler_reg, tc, 0i); let _e73 = a; a = (_e73 + _e72); - let _e78 = textureSample(image_2d_array, sampler_reg, tc, 0, vec2(3, 1)); + let _e78 = textureSample(image_2d_array, sampler_reg, tc, 0i, vec2(3i, 1i)); let _e79 = a; a = (_e79 + _e78); - let _e84 = textureSampleLevel(image_2d_array, sampler_reg, tc, 0, 2.3); + let _e84 = textureSampleLevel(image_2d_array, sampler_reg, tc, 0i, 2.3); let _e85 = a; a = (_e85 + _e84); - let _e90 = textureSampleLevel(image_2d_array, sampler_reg, tc, 0, 2.3, vec2(3, 1)); + let _e90 = textureSampleLevel(image_2d_array, sampler_reg, tc, 0i, 2.3, vec2(3i, 1i)); let _e91 = a; a = (_e91 + _e90); - let _e97 = textureSampleBias(image_2d_array, sampler_reg, tc, 0, 2.0, vec2(3, 1)); + let _e97 = textureSampleBias(image_2d_array, sampler_reg, tc, 0i, 2.0, vec2(3i, 1i)); let _e98 = a; a = (_e98 + _e97); let _e103 = textureSample(image_cube_array, sampler_reg, tc3_, 0u); @@ -169,13 +169,13 @@ fn texture_sample() -> @location(0) vec4 { let _e116 = textureSampleBias(image_cube_array, sampler_reg, tc3_, 0u, 2.0); let _e117 = a; a = (_e117 + _e116); - let _e122 = textureSample(image_cube_array, sampler_reg, tc3_, 0); + let _e122 = textureSample(image_cube_array, sampler_reg, tc3_, 0i); let _e123 = a; a = (_e123 + _e122); - let _e128 = textureSampleLevel(image_cube_array, sampler_reg, tc3_, 0, 2.3); + let _e128 = textureSampleLevel(image_cube_array, sampler_reg, tc3_, 0i, 2.3); let _e129 = a; a = (_e129 + _e128); - let _e135 = textureSampleBias(image_cube_array, sampler_reg, tc3_, 0, 2.0); + let _e135 = textureSampleBias(image_cube_array, sampler_reg, tc3_, 0i, 2.0); let _e136 = a; a = (_e136 + _e135); let _e138 = a; @@ -194,7 +194,7 @@ fn texture_sample_comparison() -> @location(0) f32 { let _e14 = textureSampleCompare(image_2d_array_depth, sampler_cmp, tc_1, 0u, 0.5); let _e15 = a_1; a_1 = (_e15 + _e14); - let _e20 = textureSampleCompare(image_2d_array_depth, sampler_cmp, tc_1, 0, 0.5); + let _e20 = textureSampleCompare(image_2d_array_depth, sampler_cmp, tc_1, 0i, 0.5); let _e21 = a_1; a_1 = (_e21 + _e20); let _e25 = textureSampleCompare(image_cube_depth, sampler_cmp, tc3_1, 0.5); @@ -206,7 +206,7 @@ fn texture_sample_comparison() -> @location(0) f32 { let _e36 = textureSampleCompareLevel(image_2d_array_depth, sampler_cmp, tc_1, 0u, 0.5); let _e37 = a_1; a_1 = (_e37 + _e36); - let _e42 = textureSampleCompareLevel(image_2d_array_depth, sampler_cmp, tc_1, 0, 0.5); + let _e42 = textureSampleCompareLevel(image_2d_array_depth, sampler_cmp, tc_1, 0i, 0.5); let _e43 = a_1; a_1 = (_e43 + _e42); let _e47 = textureSampleCompareLevel(image_cube_depth, sampler_cmp, tc3_1, 0.5); @@ -220,9 +220,9 @@ fn texture_sample_comparison() -> @location(0) f32 { fn gather() -> @location(0) vec4 { let tc_2 = vec2(0.5); let s2d = textureGather(1, image_2d, sampler_reg, tc_2); - let s2d_offset = textureGather(3, image_2d, sampler_reg, tc_2, vec2(3, 1)); + let s2d_offset = textureGather(3, image_2d, sampler_reg, tc_2, vec2(3i, 1i)); let s2d_depth = textureGatherCompare(image_2d_depth, sampler_cmp, tc_2, 0.5); - let s2d_depth_offset = textureGatherCompare(image_2d_depth, sampler_cmp, tc_2, 0.5, vec2(3, 1)); + let s2d_depth_offset = textureGatherCompare(image_2d_depth, sampler_cmp, tc_2, 0.5, vec2(3i, 1i)); let u = textureGather(0, image_2d_u32_, sampler_reg, tc_2); let i = textureGather(0, image_2d_i32_, sampler_reg, tc_2); let f = (vec4(u) + vec4(i)); diff --git a/naga/tests/out/wgsl/lexical-scopes.wgsl b/naga/tests/out/wgsl/lexical-scopes.wgsl index f3756b61bf..e787f96b10 100644 --- a/naga/tests/out/wgsl/lexical-scopes.wgsl +++ b/naga/tests/out/wgsl/lexical-scopes.wgsl @@ -21,11 +21,11 @@ fn loopLexicalScope(a_2: bool) { } fn forLexicalScope(a_3: f32) { - var a_4: i32 = 0; + var a_4: i32 = 0i; loop { let _e3 = a_4; - if (_e3 < 1) { + if (_e3 < 1i) { } else { break; } @@ -33,7 +33,7 @@ fn forLexicalScope(a_3: f32) { } continuing { let _e8 = a_4; - a_4 = (_e8 + 1); + a_4 = (_e8 + 1i); } } return; @@ -41,7 +41,7 @@ fn forLexicalScope(a_3: f32) { fn whileLexicalScope(a_5: i32) { loop { - if (a_5 > 2) { + if (a_5 > 2i) { } else { break; } @@ -60,6 +60,6 @@ fn switchLexicalScope(a_6: i32) { default: { } } - let test = (a_6 == 2); + let test = (a_6 == 2i); } diff --git a/naga/tests/out/wgsl/local-var-init-in-loop.comp.wgsl b/naga/tests/out/wgsl/local-var-init-in-loop.comp.wgsl index 7675a54cef..c7e47c2e68 100644 --- a/naga/tests/out/wgsl/local-var-init-in-loop.comp.wgsl +++ b/naga/tests/out/wgsl/local-var-init-in-loop.comp.wgsl @@ -1,11 +1,11 @@ fn main_1() { var sum: vec4 = vec4(0.0); - var i: i32 = 0; + var i: i32 = 0i; var a: vec4; loop { let _e6 = i; - if !((_e6 < 4)) { + if !((_e6 < 4i)) { break; } { @@ -16,7 +16,7 @@ fn main_1() { } continuing { let _e10 = i; - i = (_e10 + 1); + i = (_e10 + 1i); } } return; diff --git a/naga/tests/out/wgsl/math-functions.frag.wgsl b/naga/tests/out/wgsl/math-functions.frag.wgsl index 0e3b5c3844..dfe3b79eee 100644 --- a/naga/tests/out/wgsl/math-functions.frag.wgsl +++ b/naga/tests/out/wgsl/math-functions.frag.wgsl @@ -2,7 +2,7 @@ fn main_1() { var a: vec4 = vec4(1.0); var b: vec4 = vec4(2.0); var m: mat4x4; - var i: i32 = 5; + var i: i32 = 5i; var ceilOut: vec4; var roundOut: vec4; var floorOut: vec4; diff --git a/naga/tests/out/wgsl/math-functions.wgsl b/naga/tests/out/wgsl/math-functions.wgsl index e6742fd31e..1863f8bccc 100644 --- a/naga/tests/out/wgsl/math-functions.wgsl +++ b/naga/tests/out/wgsl/math-functions.wgsl @@ -7,33 +7,33 @@ fn main() { let d = radians(v); let e = saturate(v); let g = refract(v, v, 1.0); - let sign_a = sign(-1); - let sign_b = sign(vec4(-1)); + let sign_a = sign(-1i); + let sign_b = sign(vec4(-1i)); let sign_c = sign(-1.0); let sign_d = sign(vec4(-1.0)); let const_dot = dot(vec2(), vec2()); let first_leading_bit_abs = firstLeadingBit(abs(0u)); - let flb_a = firstLeadingBit(-1); - let flb_b = firstLeadingBit(vec2(-1)); + let flb_a = firstLeadingBit(-1i); + let flb_b = firstLeadingBit(vec2(-1i)); let flb_c = firstLeadingBit(vec2(1u)); - let ftb_a = firstTrailingBit(-1); + let ftb_a = firstTrailingBit(-1i); let ftb_b = firstTrailingBit(1u); - let ftb_c = firstTrailingBit(vec2(-1)); + let ftb_c = firstTrailingBit(vec2(-1i)); let ftb_d = firstTrailingBit(vec2(1u)); let ctz_a = countTrailingZeros(0u); - let ctz_b = countTrailingZeros(0); + let ctz_b = countTrailingZeros(0i); let ctz_c = countTrailingZeros(4294967295u); - let ctz_d = countTrailingZeros(-1); + let ctz_d = countTrailingZeros(-1i); let ctz_e = countTrailingZeros(vec2(0u)); - let ctz_f = countTrailingZeros(vec2(0)); + let ctz_f = countTrailingZeros(vec2(0i)); let ctz_g = countTrailingZeros(vec2(1u)); - let ctz_h = countTrailingZeros(vec2(1)); - let clz_a = countLeadingZeros(-1); + let ctz_h = countTrailingZeros(vec2(1i)); + let clz_a = countLeadingZeros(-1i); let clz_b = countLeadingZeros(1u); - let clz_c = countLeadingZeros(vec2(-1)); + let clz_c = countLeadingZeros(vec2(-1i)); let clz_d = countLeadingZeros(vec2(1u)); - let lde_a = ldexp(1.0, 2); - let lde_b = ldexp(vec2(1.0, 2.0), vec2(3, 4)); + let lde_a = ldexp(1.0, 2i); + let lde_b = ldexp(vec2(1.0, 2.0), vec2(3i, 4i)); let modf_a = modf(1.5); let modf_b = modf(1.5).fract; let modf_c = modf(1.5).whole; diff --git a/naga/tests/out/wgsl/module-scope.wgsl b/naga/tests/out/wgsl/module-scope.wgsl index b746ff37ca..5ee6bb244c 100644 --- a/naga/tests/out/wgsl/module-scope.wgsl +++ b/naga/tests/out/wgsl/module-scope.wgsl @@ -2,7 +2,7 @@ struct S { x: i32, } -const Value: i32 = 1; +const Value: i32 = 1i; @group(0) @binding(0) var Texture: texture_2d; @@ -14,7 +14,7 @@ fn statement() { } fn returns() -> S { - return S(1); + return S(1i); } fn call() { diff --git a/naga/tests/out/wgsl/operators.wgsl b/naga/tests/out/wgsl/operators.wgsl index 95621e32e2..d14681adab 100644 --- a/naga/tests/out/wgsl/operators.wgsl +++ b/naga/tests/out/wgsl/operators.wgsl @@ -1,23 +1,23 @@ const v_f32_one: vec4 = vec4(1.0, 1.0, 1.0, 1.0); const v_f32_zero: vec4 = vec4(0.0, 0.0, 0.0, 0.0); const v_f32_half: vec4 = vec4(0.5, 0.5, 0.5, 0.5); -const v_i32_one: vec4 = vec4(1, 1, 1, 1); +const v_i32_one: vec4 = vec4(1i, 1i, 1i, 1i); fn builtins() -> vec4 { - let s1_ = select(0, 1, true); + let s1_ = select(0i, 1i, true); let s2_ = select(v_f32_zero, v_f32_one, true); let s3_ = select(v_f32_one, v_f32_zero, vec4(false, false, false, false)); let m1_ = mix(v_f32_zero, v_f32_one, v_f32_half); let m2_ = mix(v_f32_zero, v_f32_one, 0.1); - let b1_ = bitcast(1); + let b1_ = bitcast(1i); let b2_ = bitcast>(v_i32_one); - let v_i32_zero = vec4(0, 0, 0, 0); + let v_i32_zero = vec4(0i, 0i, 0i, 0i); return (((((vec4((vec4(s1_) + v_i32_zero)) + s2_) + m1_) + m2_) + vec4(b1_)) + b2_); } fn splat() -> vec4 { let a_2 = (((vec2(1.0) + vec2(2.0)) - vec2(3.0)) / vec2(4.0)); - let b = (vec4(5) % vec4(2)); + let b = (vec4(5i) % vec4(2i)); return (a_2.xyxy + vec4(b)); } @@ -52,65 +52,65 @@ fn logical() { fn arithmetic() { let neg0_1 = -(1.0); - let neg1_1 = -(vec2(1)); + let neg1_1 = -(vec2(1i)); let neg2_ = -(vec2(1.0)); - let add0_ = (2 + 1); + let add0_ = (2i + 1i); let add1_ = (2u + 1u); let add2_ = (2.0 + 1.0); - let add3_ = (vec2(2) + vec2(1)); + let add3_ = (vec2(2i) + vec2(1i)); let add4_ = (vec3(2u) + vec3(1u)); let add5_ = (vec4(2.0) + vec4(1.0)); - let sub0_ = (2 - 1); + let sub0_ = (2i - 1i); let sub1_ = (2u - 1u); let sub2_ = (2.0 - 1.0); - let sub3_ = (vec2(2) - vec2(1)); + let sub3_ = (vec2(2i) - vec2(1i)); let sub4_ = (vec3(2u) - vec3(1u)); let sub5_ = (vec4(2.0) - vec4(1.0)); - let mul0_ = (2 * 1); + let mul0_ = (2i * 1i); let mul1_ = (2u * 1u); let mul2_ = (2.0 * 1.0); - let mul3_ = (vec2(2) * vec2(1)); + let mul3_ = (vec2(2i) * vec2(1i)); let mul4_ = (vec3(2u) * vec3(1u)); let mul5_ = (vec4(2.0) * vec4(1.0)); - let div0_ = (2 / 1); + let div0_ = (2i / 1i); let div1_ = (2u / 1u); let div2_ = (2.0 / 1.0); - let div3_ = (vec2(2) / vec2(1)); + let div3_ = (vec2(2i) / vec2(1i)); let div4_ = (vec3(2u) / vec3(1u)); let div5_ = (vec4(2.0) / vec4(1.0)); - let rem0_ = (2 % 1); + let rem0_ = (2i % 1i); let rem1_ = (2u % 1u); let rem2_ = (2.0 % 1.0); - let rem3_ = (vec2(2) % vec2(1)); + let rem3_ = (vec2(2i) % vec2(1i)); let rem4_ = (vec3(2u) % vec3(1u)); let rem5_ = (vec4(2.0) % vec4(1.0)); { - let add0_1 = (vec2(2) + vec2(1)); - let add1_1 = (vec2(2) + vec2(1)); + let add0_1 = (vec2(2i) + vec2(1i)); + let add1_1 = (vec2(2i) + vec2(1i)); let add2_1 = (vec2(2u) + vec2(1u)); let add3_1 = (vec2(2u) + vec2(1u)); let add4_1 = (vec2(2.0) + vec2(1.0)); let add5_1 = (vec2(2.0) + vec2(1.0)); - let sub0_1 = (vec2(2) - vec2(1)); - let sub1_1 = (vec2(2) - vec2(1)); + let sub0_1 = (vec2(2i) - vec2(1i)); + let sub1_1 = (vec2(2i) - vec2(1i)); let sub2_1 = (vec2(2u) - vec2(1u)); let sub3_1 = (vec2(2u) - vec2(1u)); let sub4_1 = (vec2(2.0) - vec2(1.0)); let sub5_1 = (vec2(2.0) - vec2(1.0)); - let mul0_1 = (vec2(2) * 1); - let mul1_1 = (2 * vec2(1)); + let mul0_1 = (vec2(2i) * 1i); + let mul1_1 = (2i * vec2(1i)); let mul2_1 = (vec2(2u) * 1u); let mul3_1 = (2u * vec2(1u)); let mul4_1 = (vec2(2.0) * 1.0); let mul5_1 = (2.0 * vec2(1.0)); - let div0_1 = (vec2(2) / vec2(1)); - let div1_1 = (vec2(2) / vec2(1)); + let div0_1 = (vec2(2i) / vec2(1i)); + let div1_1 = (vec2(2i) / vec2(1i)); let div2_1 = (vec2(2u) / vec2(1u)); let div3_1 = (vec2(2u) / vec2(1u)); let div4_1 = (vec2(2.0) / vec2(1.0)); let div5_1 = (vec2(2.0) / vec2(1.0)); - let rem0_1 = (vec2(2) % vec2(1)); - let rem1_1 = (vec2(2) % vec2(1)); + let rem0_1 = (vec2(2i) % vec2(1i)); + let rem1_1 = (vec2(2i) % vec2(1i)); let rem2_1 = (vec2(2u) % vec2(1u)); let rem3_1 = (vec2(2u) % vec2(1u)); let rem4_1 = (vec2(2.0) % vec2(1.0)); @@ -126,67 +126,67 @@ fn arithmetic() { } fn bit() { - let flip0_ = ~(1); + let flip0_ = ~(1i); let flip1_ = ~(1u); - let flip2_ = ~(vec2(1)); + let flip2_ = ~(vec2(1i)); let flip3_ = ~(vec3(1u)); - let or0_ = (2 | 1); + let or0_ = (2i | 1i); let or1_ = (2u | 1u); - let or2_ = (vec2(2) | vec2(1)); + let or2_ = (vec2(2i) | vec2(1i)); let or3_ = (vec3(2u) | vec3(1u)); - let and0_ = (2 & 1); + let and0_ = (2i & 1i); let and1_ = (2u & 1u); - let and2_ = (vec2(2) & vec2(1)); + let and2_ = (vec2(2i) & vec2(1i)); let and3_ = (vec3(2u) & vec3(1u)); - let xor0_ = (2 ^ 1); + let xor0_ = (2i ^ 1i); let xor1_ = (2u ^ 1u); - let xor2_ = (vec2(2) ^ vec2(1)); + let xor2_ = (vec2(2i) ^ vec2(1i)); let xor3_ = (vec3(2u) ^ vec3(1u)); - let shl0_ = (2 << 1u); + let shl0_ = (2i << 1u); let shl1_ = (2u << 1u); - let shl2_ = (vec2(2) << vec2(1u)); + let shl2_ = (vec2(2i) << vec2(1u)); let shl3_ = (vec3(2u) << vec3(1u)); - let shr0_ = (2 >> 1u); + let shr0_ = (2i >> 1u); let shr1_ = (2u >> 1u); - let shr2_ = (vec2(2) >> vec2(1u)); + let shr2_ = (vec2(2i) >> vec2(1u)); let shr3_ = (vec3(2u) >> vec3(1u)); } fn comparison() { - let eq0_ = (2 == 1); + let eq0_ = (2i == 1i); let eq1_ = (2u == 1u); let eq2_ = (2.0 == 1.0); - let eq3_ = (vec2(2) == vec2(1)); + let eq3_ = (vec2(2i) == vec2(1i)); let eq4_ = (vec3(2u) == vec3(1u)); let eq5_ = (vec4(2.0) == vec4(1.0)); - let neq0_ = (2 != 1); + let neq0_ = (2i != 1i); let neq1_ = (2u != 1u); let neq2_ = (2.0 != 1.0); - let neq3_ = (vec2(2) != vec2(1)); + let neq3_ = (vec2(2i) != vec2(1i)); let neq4_ = (vec3(2u) != vec3(1u)); let neq5_ = (vec4(2.0) != vec4(1.0)); - let lt0_ = (2 < 1); + let lt0_ = (2i < 1i); let lt1_ = (2u < 1u); let lt2_ = (2.0 < 1.0); - let lt3_ = (vec2(2) < vec2(1)); + let lt3_ = (vec2(2i) < vec2(1i)); let lt4_ = (vec3(2u) < vec3(1u)); let lt5_ = (vec4(2.0) < vec4(1.0)); - let lte0_ = (2 <= 1); + let lte0_ = (2i <= 1i); let lte1_ = (2u <= 1u); let lte2_ = (2.0 <= 1.0); - let lte3_ = (vec2(2) <= vec2(1)); + let lte3_ = (vec2(2i) <= vec2(1i)); let lte4_ = (vec3(2u) <= vec3(1u)); let lte5_ = (vec4(2.0) <= vec4(1.0)); - let gt0_ = (2 > 1); + let gt0_ = (2i > 1i); let gt1_ = (2u > 1u); let gt2_ = (2.0 > 1.0); - let gt3_ = (vec2(2) > vec2(1)); + let gt3_ = (vec2(2i) > vec2(1i)); let gt4_ = (vec3(2u) > vec3(1u)); let gt5_ = (vec4(2.0) > vec4(1.0)); - let gte0_ = (2 >= 1); + let gte0_ = (2i >= 1i); let gte1_ = (2u >= 1u); let gte2_ = (2.0 >= 1.0); - let gte3_ = (vec2(2) >= vec2(1)); + let gte3_ = (vec2(2i) >= vec2(1i)); let gte4_ = (vec3(2u) >= vec3(1u)); let gte5_ = (vec4(2.0) >= vec4(1.0)); } @@ -195,11 +195,11 @@ fn assignment() { var a_1: i32; var vec0_: vec3 = vec3(); - a_1 = 1; + a_1 = 1i; let _e5 = a_1; - a_1 = (_e5 + 1); + a_1 = (_e5 + 1i); let _e7 = a_1; - a_1 = (_e7 - 1); + a_1 = (_e7 - 1i); let _e9 = a_1; let _e10 = a_1; a_1 = (_e10 * _e9); @@ -207,37 +207,37 @@ fn assignment() { let _e13 = a_1; a_1 = (_e13 / _e12); let _e15 = a_1; - a_1 = (_e15 % 1); + a_1 = (_e15 % 1i); let _e17 = a_1; - a_1 = (_e17 & 0); + a_1 = (_e17 & 0i); let _e19 = a_1; - a_1 = (_e19 | 0); + a_1 = (_e19 | 0i); let _e21 = a_1; - a_1 = (_e21 ^ 0); + a_1 = (_e21 ^ 0i); let _e23 = a_1; a_1 = (_e23 << 2u); let _e25 = a_1; a_1 = (_e25 >> 1u); let _e28 = a_1; - a_1 = (_e28 + 1); + a_1 = (_e28 + 1i); let _e31 = a_1; - a_1 = (_e31 - 1); - let _e37 = vec0_[1]; - vec0_[1] = (_e37 + 1); - let _e41 = vec0_[1]; - vec0_[1] = (_e41 - 1); + a_1 = (_e31 - 1i); + let _e37 = vec0_[1i]; + vec0_[1i] = (_e37 + 1i); + let _e41 = vec0_[1i]; + vec0_[1i] = (_e41 - 1i); return; } fn negation_avoids_prefix_decrement() { - let p0_ = -(1); - let p1_ = -(-(1)); - let p2_ = -(-(1)); - let p3_ = -(-(1)); - let p4_ = -(-(-(1))); - let p5_ = -(-(-(-(1)))); - let p6_ = -(-(-(-(-(1))))); - let p7_ = -(-(-(-(-(1))))); + let p0_ = -(1i); + let p1_ = -(-(1i)); + let p2_ = -(-(1i)); + let p3_ = -(-(1i)); + let p4_ = -(-(-(1i))); + let p5_ = -(-(-(-(1i)))); + let p6_ = -(-(-(-(-(1i))))); + let p7_ = -(-(-(-(-(1i))))); } @compute @workgroup_size(1, 1, 1) diff --git a/naga/tests/out/wgsl/pointers.wgsl b/naga/tests/out/wgsl/pointers.wgsl index 5269e16f7a..310f53cf08 100644 --- a/naga/tests/out/wgsl/pointers.wgsl +++ b/naga/tests/out/wgsl/pointers.wgsl @@ -9,7 +9,7 @@ fn f() { var v: vec2; let px = (&v.x); - (*px) = 10; + (*px) = 10i; return; } diff --git a/naga/tests/out/wgsl/prepostfix.frag.wgsl b/naga/tests/out/wgsl/prepostfix.frag.wgsl index 3a98925a90..63e97e6dab 100644 --- a/naga/tests/out/wgsl/prepostfix.frag.wgsl +++ b/naga/tests/out/wgsl/prepostfix.frag.wgsl @@ -1,16 +1,16 @@ fn main_1() { var scalar_target: i32; - var scalar: i32 = 1; + var scalar: i32 = 1i; var vec_target: vec2; var vec: vec2 = vec2(1u); var mat_target: mat4x3; var mat: mat4x3 = mat4x3(vec3(1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0), vec3(0.0, 0.0, 1.0), vec3(0.0, 0.0, 0.0)); let _e3 = scalar; - scalar = (_e3 + 1); + scalar = (_e3 + 1i); scalar_target = _e3; let _e6 = scalar; - let _e8 = (_e6 - 1); + let _e8 = (_e6 - 1i); scalar = _e8; scalar_target = _e8; let _e14 = vec; diff --git a/naga/tests/out/wgsl/samplers.frag.wgsl b/naga/tests/out/wgsl/samplers.frag.wgsl index 11565d1f5a..093ee00ffc 100644 --- a/naga/tests/out/wgsl/samplers.frag.wgsl +++ b/naga/tests/out/wgsl/samplers.frag.wgsl @@ -37,7 +37,7 @@ fn testTex1D(coord: f32) { var c: vec4; coord_1 = coord; - let _e20 = textureDimensions(tex1D, 0); + let _e20 = textureDimensions(tex1D, 0i); size1D = i32(_e20); let _e25 = coord_1; let _e26 = textureSample(tex1D, samp, _e25); @@ -49,19 +49,19 @@ fn testTex1D(coord: f32) { let _e38 = textureSampleGrad(tex1D, samp, _e35, 4.0, 4.0); c = _e38; let _e43 = coord_1; - let _e47 = textureSampleGrad(tex1D, samp, _e43, 4.0, 4.0, 5); + let _e47 = textureSampleGrad(tex1D, samp, _e43, 4.0, 4.0, 5i); c = _e47; let _e50 = coord_1; let _e52 = textureSampleLevel(tex1D, samp, _e50, 3.0); c = _e52; let _e56 = coord_1; - let _e59 = textureSampleLevel(tex1D, samp, _e56, 3.0, 5); + let _e59 = textureSampleLevel(tex1D, samp, _e56, 3.0, 5i); c = _e59; let _e62 = coord_1; - let _e64 = textureSample(tex1D, samp, _e62, 5); + let _e64 = textureSample(tex1D, samp, _e62, 5i); c = _e64; let _e68 = coord_1; - let _e71 = textureSampleBias(tex1D, samp, _e68, 2.0, 5); + let _e71 = textureSampleBias(tex1D, samp, _e68, 2.0, 5i); c = _e71; let _e72 = coord_1; let _e75 = coord_1; @@ -96,12 +96,12 @@ fn testTex1D(coord: f32) { let _e162 = coord_1; let _e168 = coord_1; let _e170 = vec2(_e168, 6.0); - let _e177 = textureSampleGrad(tex1D, samp, (_e170.x / _e170.y), 4.0, 4.0, 5); + let _e177 = textureSampleGrad(tex1D, samp, (_e170.x / _e170.y), 4.0, 4.0, 5i); c = _e177; let _e178 = coord_1; let _e186 = coord_1; let _e190 = vec4(_e186, 0.0, 0.0, 6.0); - let _e199 = textureSampleGrad(tex1D, samp, (_e190.xyz / vec3(_e190.w)).x, 4.0, 4.0, 5); + let _e199 = textureSampleGrad(tex1D, samp, (_e190.xyz / vec3(_e190.w)).x, 4.0, 4.0, 5i); c = _e199; let _e200 = coord_1; let _e204 = coord_1; @@ -116,40 +116,40 @@ fn testTex1D(coord: f32) { let _e230 = coord_1; let _e235 = coord_1; let _e237 = vec2(_e235, 6.0); - let _e243 = textureSampleLevel(tex1D, samp, (_e237.x / _e237.y), 3.0, 5); + let _e243 = textureSampleLevel(tex1D, samp, (_e237.x / _e237.y), 3.0, 5i); c = _e243; let _e244 = coord_1; let _e251 = coord_1; let _e255 = vec4(_e251, 0.0, 0.0, 6.0); - let _e263 = textureSampleLevel(tex1D, samp, (_e255.xyz / vec3(_e255.w)).x, 3.0, 5); + let _e263 = textureSampleLevel(tex1D, samp, (_e255.xyz / vec3(_e255.w)).x, 3.0, 5i); c = _e263; let _e264 = coord_1; let _e268 = coord_1; let _e270 = vec2(_e268, 6.0); - let _e275 = textureSample(tex1D, samp, (_e270.x / _e270.y), 5); + let _e275 = textureSample(tex1D, samp, (_e270.x / _e270.y), 5i); c = _e275; let _e276 = coord_1; let _e282 = coord_1; let _e286 = vec4(_e282, 0.0, 0.0, 6.0); - let _e293 = textureSample(tex1D, samp, (_e286.xyz / vec3(_e286.w)).x, 5); + let _e293 = textureSample(tex1D, samp, (_e286.xyz / vec3(_e286.w)).x, 5i); c = _e293; let _e294 = coord_1; let _e299 = coord_1; let _e301 = vec2(_e299, 6.0); - let _e307 = textureSampleBias(tex1D, samp, (_e301.x / _e301.y), 2.0, 5); + let _e307 = textureSampleBias(tex1D, samp, (_e301.x / _e301.y), 2.0, 5i); c = _e307; let _e308 = coord_1; let _e315 = coord_1; let _e319 = vec4(_e315, 0.0, 0.0, 6.0); - let _e327 = textureSampleBias(tex1D, samp, (_e319.xyz / vec3(_e319.w)).x, 2.0, 5); + let _e327 = textureSampleBias(tex1D, samp, (_e319.xyz / vec3(_e319.w)).x, 2.0, 5i); c = _e327; let _e328 = coord_1; let _e331 = coord_1; - let _e334 = textureLoad(tex1D, i32(_e331), 3); + let _e334 = textureLoad(tex1D, i32(_e331), 3i); c = _e334; let _e335 = coord_1; let _e339 = coord_1; - let _e343 = textureLoad(tex1D, i32(_e339), 3); + let _e343 = textureLoad(tex1D, i32(_e339), 3i); c = _e343; return; } @@ -160,7 +160,7 @@ fn testTex1DArray(coord_2: vec2) { var c_1: vec4; coord_3 = coord_2; - let _e20 = textureDimensions(tex1DArray, 0); + let _e20 = textureDimensions(tex1DArray, 0i); let _e21 = textureNumLayers(tex1DArray); size1DArray = vec2(vec2(_e20, _e21)); let _e27 = coord_3; @@ -173,29 +173,29 @@ fn testTex1DArray(coord_2: vec2) { let _e49 = textureSampleGrad(tex1DArray, samp, _e43.x, i32(_e43.y), 4.0, 4.0); c_1 = _e49; let _e54 = coord_3; - let _e61 = textureSampleGrad(tex1DArray, samp, _e54.x, i32(_e54.y), 4.0, 4.0, 5); + let _e61 = textureSampleGrad(tex1DArray, samp, _e54.x, i32(_e54.y), 4.0, 4.0, 5i); c_1 = _e61; let _e64 = coord_3; let _e69 = textureSampleLevel(tex1DArray, samp, _e64.x, i32(_e64.y), 3.0); c_1 = _e69; let _e73 = coord_3; - let _e79 = textureSampleLevel(tex1DArray, samp, _e73.x, i32(_e73.y), 3.0, 5); + let _e79 = textureSampleLevel(tex1DArray, samp, _e73.x, i32(_e73.y), 3.0, 5i); c_1 = _e79; let _e82 = coord_3; - let _e87 = textureSample(tex1DArray, samp, _e82.x, i32(_e82.y), 5); + let _e87 = textureSample(tex1DArray, samp, _e82.x, i32(_e82.y), 5i); c_1 = _e87; let _e91 = coord_3; - let _e97 = textureSampleBias(tex1DArray, samp, _e91.x, i32(_e91.y), 2.0, 5); + let _e97 = textureSampleBias(tex1DArray, samp, _e91.x, i32(_e91.y), 2.0, 5i); c_1 = _e97; let _e98 = coord_3; let _e101 = coord_3; let _e102 = vec2(_e101); - let _e106 = textureLoad(tex1DArray, _e102.x, _e102.y, 3); + let _e106 = textureLoad(tex1DArray, _e102.x, _e102.y, 3i); c_1 = _e106; let _e107 = coord_3; let _e111 = coord_3; let _e112 = vec2(_e111); - let _e117 = textureLoad(tex1DArray, _e112.x, _e112.y, 3); + let _e117 = textureLoad(tex1DArray, _e112.x, _e112.y, 3i); c_1 = _e117; return; } @@ -206,7 +206,7 @@ fn testTex2D(coord_4: vec2) { var c_2: vec4; coord_5 = coord_4; - let _e20 = textureDimensions(tex2D, 0); + let _e20 = textureDimensions(tex2D, 0i); size2D = vec2(_e20); let _e25 = coord_5; let _e26 = textureSample(tex2D, samp, _e25); @@ -218,19 +218,19 @@ fn testTex2D(coord_4: vec2) { let _e42 = textureSampleGrad(tex2D, samp, _e37, vec2(4.0), vec2(4.0)); c_2 = _e42; let _e50 = coord_5; - let _e57 = textureSampleGrad(tex2D, samp, _e50, vec2(4.0), vec2(4.0), vec2(5)); + let _e57 = textureSampleGrad(tex2D, samp, _e50, vec2(4.0), vec2(4.0), vec2(5i)); c_2 = _e57; let _e60 = coord_5; let _e62 = textureSampleLevel(tex2D, samp, _e60, 3.0); c_2 = _e62; let _e67 = coord_5; - let _e71 = textureSampleLevel(tex2D, samp, _e67, 3.0, vec2(5)); + let _e71 = textureSampleLevel(tex2D, samp, _e67, 3.0, vec2(5i)); c_2 = _e71; let _e75 = coord_5; - let _e78 = textureSample(tex2D, samp, _e75, vec2(5)); + let _e78 = textureSample(tex2D, samp, _e75, vec2(5i)); c_2 = _e78; let _e83 = coord_5; - let _e87 = textureSampleBias(tex2D, samp, _e83, 2.0, vec2(5)); + let _e87 = textureSampleBias(tex2D, samp, _e83, 2.0, vec2(5i)); c_2 = _e87; let _e88 = coord_5; let _e93 = coord_5; @@ -265,12 +265,12 @@ fn testTex2D(coord_4: vec2) { let _e207 = coord_5; let _e218 = coord_5; let _e222 = vec3(_e218.x, _e218.y, 6.0); - let _e233 = textureSampleGrad(tex2D, samp, (_e222.xy / vec2(_e222.z)), vec2(4.0), vec2(4.0), vec2(5)); + let _e233 = textureSampleGrad(tex2D, samp, (_e222.xy / vec2(_e222.z)), vec2(4.0), vec2(4.0), vec2(5i)); c_2 = _e233; let _e234 = coord_5; let _e246 = coord_5; let _e251 = vec4(_e246.x, _e246.y, 0.0, 6.0); - let _e263 = textureSampleGrad(tex2D, samp, (_e251.xyz / vec3(_e251.w)).xy, vec2(4.0), vec2(4.0), vec2(5)); + let _e263 = textureSampleGrad(tex2D, samp, (_e251.xyz / vec3(_e251.w)).xy, vec2(4.0), vec2(4.0), vec2(5i)); c_2 = _e263; let _e264 = coord_5; let _e270 = coord_5; @@ -285,40 +285,40 @@ fn testTex2D(coord_4: vec2) { let _e301 = coord_5; let _e309 = coord_5; let _e313 = vec3(_e309.x, _e309.y, 6.0); - let _e321 = textureSampleLevel(tex2D, samp, (_e313.xy / vec2(_e313.z)), 3.0, vec2(5)); + let _e321 = textureSampleLevel(tex2D, samp, (_e313.xy / vec2(_e313.z)), 3.0, vec2(5i)); c_2 = _e321; let _e322 = coord_5; let _e331 = coord_5; let _e336 = vec4(_e331.x, _e331.y, 0.0, 6.0); - let _e345 = textureSampleLevel(tex2D, samp, (_e336.xyz / vec3(_e336.w)).xy, 3.0, vec2(5)); + let _e345 = textureSampleLevel(tex2D, samp, (_e336.xyz / vec3(_e336.w)).xy, 3.0, vec2(5i)); c_2 = _e345; let _e346 = coord_5; let _e353 = coord_5; let _e357 = vec3(_e353.x, _e353.y, 6.0); - let _e364 = textureSample(tex2D, samp, (_e357.xy / vec2(_e357.z)), vec2(5)); + let _e364 = textureSample(tex2D, samp, (_e357.xy / vec2(_e357.z)), vec2(5i)); c_2 = _e364; let _e365 = coord_5; let _e373 = coord_5; let _e378 = vec4(_e373.x, _e373.y, 0.0, 6.0); - let _e386 = textureSample(tex2D, samp, (_e378.xyz / vec3(_e378.w)).xy, vec2(5)); + let _e386 = textureSample(tex2D, samp, (_e378.xyz / vec3(_e378.w)).xy, vec2(5i)); c_2 = _e386; let _e387 = coord_5; let _e395 = coord_5; let _e399 = vec3(_e395.x, _e395.y, 6.0); - let _e407 = textureSampleBias(tex2D, samp, (_e399.xy / vec2(_e399.z)), 2.0, vec2(5)); + let _e407 = textureSampleBias(tex2D, samp, (_e399.xy / vec2(_e399.z)), 2.0, vec2(5i)); c_2 = _e407; let _e408 = coord_5; let _e417 = coord_5; let _e422 = vec4(_e417.x, _e417.y, 0.0, 6.0); - let _e431 = textureSampleBias(tex2D, samp, (_e422.xyz / vec3(_e422.w)).xy, 2.0, vec2(5)); + let _e431 = textureSampleBias(tex2D, samp, (_e422.xyz / vec3(_e422.w)).xy, 2.0, vec2(5i)); c_2 = _e431; let _e432 = coord_5; let _e435 = coord_5; - let _e438 = textureLoad(tex2D, vec2(_e435), 3); + let _e438 = textureLoad(tex2D, vec2(_e435), 3i); c_2 = _e438; let _e439 = coord_5; let _e444 = coord_5; - let _e449 = textureLoad(tex2D, vec2(_e444), 3); + let _e449 = textureLoad(tex2D, vec2(_e444), 3i); c_2 = _e449; return; } @@ -329,7 +329,7 @@ fn testTex2DShadow(coord_6: vec2) { var d: f32; coord_7 = coord_6; - let _e20 = textureDimensions(tex2DShadow, 0); + let _e20 = textureDimensions(tex2DShadow, 0i); size2DShadow = vec2(_e20); let _e24 = coord_7; let _e29 = coord_7; @@ -344,7 +344,7 @@ fn testTex2DShadow(coord_6: vec2) { let _e58 = coord_7; let _e69 = coord_7; let _e73 = vec3(_e69.x, _e69.y, 1.0); - let _e82 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e73.xy, _e73.z, vec2(5)); + let _e82 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e73.xy, _e73.z, vec2(5i)); d = _e82; let _e83 = coord_7; let _e89 = coord_7; @@ -354,12 +354,12 @@ fn testTex2DShadow(coord_6: vec2) { let _e98 = coord_7; let _e106 = coord_7; let _e110 = vec3(_e106.x, _e106.y, 1.0); - let _e116 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e110.xy, _e110.z, vec2(5)); + let _e116 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e110.xy, _e110.z, vec2(5i)); d = _e116; let _e117 = coord_7; let _e124 = coord_7; let _e128 = vec3(_e124.x, _e124.y, 1.0); - let _e133 = textureSampleCompare(tex2DShadow, sampShadow, _e128.xy, _e128.z, vec2(5)); + let _e133 = textureSampleCompare(tex2DShadow, sampShadow, _e128.xy, _e128.z, vec2(5i)); d = _e133; let _e134 = coord_7; let _e140 = coord_7; @@ -377,7 +377,7 @@ fn testTex2DShadow(coord_6: vec2) { let _e192 = coord_7; let _e197 = vec4(_e192.x, _e192.y, 1.0, 6.0); let _e207 = (_e197.xyz / vec3(_e197.w)); - let _e210 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e207.xy, _e207.z, vec2(5)); + let _e210 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e207.xy, _e207.z, vec2(5i)); d = _e210; let _e211 = coord_7; let _e218 = coord_7; @@ -389,13 +389,13 @@ fn testTex2DShadow(coord_6: vec2) { let _e241 = coord_7; let _e246 = vec4(_e241.x, _e241.y, 1.0, 6.0); let _e253 = (_e246.xyz / vec3(_e246.w)); - let _e256 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e253.xy, _e253.z, vec2(5)); + let _e256 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e253.xy, _e253.z, vec2(5i)); d = _e256; let _e257 = coord_7; let _e265 = coord_7; let _e270 = vec4(_e265.x, _e265.y, 1.0, 6.0); let _e276 = (_e270.xyz / vec3(_e270.w)); - let _e279 = textureSampleCompare(tex2DShadow, sampShadow, _e276.xy, _e276.z, vec2(5)); + let _e279 = textureSampleCompare(tex2DShadow, sampShadow, _e276.xy, _e276.z, vec2(5i)); d = _e279; return; } @@ -406,7 +406,7 @@ fn testTex2DArray(coord_8: vec3) { var c_3: vec4; coord_9 = coord_8; - let _e20 = textureDimensions(tex2DArray, 0); + let _e20 = textureDimensions(tex2DArray, 0i); let _e23 = textureNumLayers(tex2DArray); size2DArray = vec3(vec3(_e20.x, _e20.y, _e23)); let _e29 = coord_9; @@ -419,29 +419,29 @@ fn testTex2DArray(coord_8: vec3) { let _e55 = textureSampleGrad(tex2DArray, samp, _e47.xy, i32(_e47.z), vec2(4.0), vec2(4.0)); c_3 = _e55; let _e63 = coord_9; - let _e73 = textureSampleGrad(tex2DArray, samp, _e63.xy, i32(_e63.z), vec2(4.0), vec2(4.0), vec2(5)); + let _e73 = textureSampleGrad(tex2DArray, samp, _e63.xy, i32(_e63.z), vec2(4.0), vec2(4.0), vec2(5i)); c_3 = _e73; let _e76 = coord_9; let _e81 = textureSampleLevel(tex2DArray, samp, _e76.xy, i32(_e76.z), 3.0); c_3 = _e81; let _e86 = coord_9; - let _e93 = textureSampleLevel(tex2DArray, samp, _e86.xy, i32(_e86.z), 3.0, vec2(5)); + let _e93 = textureSampleLevel(tex2DArray, samp, _e86.xy, i32(_e86.z), 3.0, vec2(5i)); c_3 = _e93; let _e97 = coord_9; - let _e103 = textureSample(tex2DArray, samp, _e97.xy, i32(_e97.z), vec2(5)); + let _e103 = textureSample(tex2DArray, samp, _e97.xy, i32(_e97.z), vec2(5i)); c_3 = _e103; let _e108 = coord_9; - let _e115 = textureSampleBias(tex2DArray, samp, _e108.xy, i32(_e108.z), 2.0, vec2(5)); + let _e115 = textureSampleBias(tex2DArray, samp, _e108.xy, i32(_e108.z), 2.0, vec2(5i)); c_3 = _e115; let _e116 = coord_9; let _e119 = coord_9; let _e120 = vec3(_e119); - let _e124 = textureLoad(tex2DArray, _e120.xy, _e120.z, 3); + let _e124 = textureLoad(tex2DArray, _e120.xy, _e120.z, 3i); c_3 = _e124; let _e125 = coord_9; let _e130 = coord_9; let _e131 = vec3(_e130); - let _e137 = textureLoad(tex2DArray, _e131.xy, _e131.z, 3); + let _e137 = textureLoad(tex2DArray, _e131.xy, _e131.z, 3i); c_3 = _e137; return; } @@ -452,7 +452,7 @@ fn testTex2DArrayShadow(coord_10: vec3) { var d_1: f32; coord_11 = coord_10; - let _e20 = textureDimensions(tex2DArrayShadow, 0); + let _e20 = textureDimensions(tex2DArrayShadow, 0i); let _e23 = textureNumLayers(tex2DArrayShadow); size2DArrayShadow = vec3(vec3(_e20.x, _e20.y, _e23)); let _e28 = coord_11; @@ -468,12 +468,12 @@ fn testTex2DArrayShadow(coord_10: vec3) { let _e70 = coord_11; let _e82 = coord_11; let _e87 = vec4(_e82.x, _e82.y, _e82.z, 1.0); - let _e98 = textureSampleCompareLevel(tex2DArrayShadow, sampShadow, _e87.xy, i32(_e87.z), _e87.w, vec2(5)); + let _e98 = textureSampleCompareLevel(tex2DArrayShadow, sampShadow, _e87.xy, i32(_e87.z), _e87.w, vec2(5i)); d_1 = _e98; let _e99 = coord_11; let _e107 = coord_11; let _e112 = vec4(_e107.x, _e107.y, _e107.z, 1.0); - let _e119 = textureSampleCompare(tex2DArrayShadow, sampShadow, _e112.xy, i32(_e112.z), _e112.w, vec2(5)); + let _e119 = textureSampleCompare(tex2DArrayShadow, sampShadow, _e112.xy, i32(_e112.z), _e112.w, vec2(5i)); d_1 = _e119; return; } @@ -484,7 +484,7 @@ fn testTexCube(coord_12: vec3) { var c_4: vec4; coord_13 = coord_12; - let _e20 = textureDimensions(texCube, 0); + let _e20 = textureDimensions(texCube, 0i); sizeCube = vec2(_e20); let _e25 = coord_13; let _e26 = textureSample(texCube, samp, _e25); @@ -507,7 +507,7 @@ fn testTexCubeShadow(coord_14: vec3) { var d_2: f32; coord_15 = coord_14; - let _e20 = textureDimensions(texCubeShadow, 0); + let _e20 = textureDimensions(texCubeShadow, 0i); sizeCubeShadow = vec2(_e20); let _e24 = coord_15; let _e30 = coord_15; @@ -528,7 +528,7 @@ fn testTexCubeArray(coord_16: vec4) { var c_5: vec4; coord_17 = coord_16; - let _e20 = textureDimensions(texCubeArray, 0); + let _e20 = textureDimensions(texCubeArray, 0i); let _e23 = textureNumLayers(texCubeArray); sizeCubeArray = vec3(vec3(_e20.x, _e20.y, _e23)); let _e29 = coord_17; @@ -552,7 +552,7 @@ fn testTexCubeArrayShadow(coord_18: vec4) { var d_3: f32; coord_19 = coord_18; - let _e20 = textureDimensions(texCubeArrayShadow, 0); + let _e20 = textureDimensions(texCubeArrayShadow, 0i); let _e23 = textureNumLayers(texCubeArrayShadow); sizeCubeArrayShadow = vec3(vec3(_e20.x, _e20.y, _e23)); let _e30 = coord_19; @@ -567,7 +567,7 @@ fn testTex3D(coord_20: vec3) { var c_6: vec4; coord_21 = coord_20; - let _e20 = textureDimensions(tex3D, 0); + let _e20 = textureDimensions(tex3D, 0i); size3D = vec3(_e20); let _e25 = coord_21; let _e26 = textureSample(tex3D, samp, _e25); @@ -588,12 +588,12 @@ fn testTex3D(coord_20: vec3) { let _e68 = coord_21; let _e76 = coord_21; let _e81 = vec4(_e76.x, _e76.y, _e76.z, 6.0); - let _e88 = textureSample(tex3D, samp, (_e81.xyz / vec3(_e81.w)), vec3(5)); + let _e88 = textureSample(tex3D, samp, (_e81.xyz / vec3(_e81.w)), vec3(5i)); c_6 = _e88; let _e89 = coord_21; let _e98 = coord_21; let _e103 = vec4(_e98.x, _e98.y, _e98.z, 6.0); - let _e111 = textureSampleBias(tex3D, samp, (_e103.xyz / vec3(_e103.w)), 2.0, vec3(5)); + let _e111 = textureSampleBias(tex3D, samp, (_e103.xyz / vec3(_e103.w)), 2.0, vec3(5i)); c_6 = _e111; let _e112 = coord_21; let _e119 = coord_21; @@ -603,7 +603,7 @@ fn testTex3D(coord_20: vec3) { let _e131 = coord_21; let _e140 = coord_21; let _e145 = vec4(_e140.x, _e140.y, _e140.z, 6.0); - let _e153 = textureSampleLevel(tex3D, samp, (_e145.xyz / vec3(_e145.w)), 3.0, vec3(5)); + let _e153 = textureSampleLevel(tex3D, samp, (_e145.xyz / vec3(_e145.w)), 3.0, vec3(5i)); c_6 = _e153; let _e154 = coord_21; let _e164 = coord_21; @@ -613,33 +613,33 @@ fn testTex3D(coord_20: vec3) { let _e179 = coord_21; let _e191 = coord_21; let _e196 = vec4(_e191.x, _e191.y, _e191.z, 6.0); - let _e207 = textureSampleGrad(tex3D, samp, (_e196.xyz / vec3(_e196.w)), vec3(4.0), vec3(4.0), vec3(5)); + let _e207 = textureSampleGrad(tex3D, samp, (_e196.xyz / vec3(_e196.w)), vec3(4.0), vec3(4.0), vec3(5i)); c_6 = _e207; let _e213 = coord_21; let _e218 = textureSampleGrad(tex3D, samp, _e213, vec3(4.0), vec3(4.0)); c_6 = _e218; let _e226 = coord_21; - let _e233 = textureSampleGrad(tex3D, samp, _e226, vec3(4.0), vec3(4.0), vec3(5)); + let _e233 = textureSampleGrad(tex3D, samp, _e226, vec3(4.0), vec3(4.0), vec3(5i)); c_6 = _e233; let _e236 = coord_21; let _e238 = textureSampleLevel(tex3D, samp, _e236, 3.0); c_6 = _e238; let _e243 = coord_21; - let _e247 = textureSampleLevel(tex3D, samp, _e243, 3.0, vec3(5)); + let _e247 = textureSampleLevel(tex3D, samp, _e243, 3.0, vec3(5i)); c_6 = _e247; let _e251 = coord_21; - let _e254 = textureSample(tex3D, samp, _e251, vec3(5)); + let _e254 = textureSample(tex3D, samp, _e251, vec3(5i)); c_6 = _e254; let _e259 = coord_21; - let _e263 = textureSampleBias(tex3D, samp, _e259, 2.0, vec3(5)); + let _e263 = textureSampleBias(tex3D, samp, _e259, 2.0, vec3(5i)); c_6 = _e263; let _e264 = coord_21; let _e267 = coord_21; - let _e270 = textureLoad(tex3D, vec3(_e267), 3); + let _e270 = textureLoad(tex3D, vec3(_e267), 3i); c_6 = _e270; let _e271 = coord_21; let _e276 = coord_21; - let _e281 = textureLoad(tex3D, vec3(_e276), 3); + let _e281 = textureLoad(tex3D, vec3(_e276), 3i); c_6 = _e281; return; } @@ -654,7 +654,7 @@ fn testTex2DMS(coord_22: vec2) { size2DMS = vec2(_e18); let _e22 = coord_23; let _e25 = coord_23; - let _e28 = textureLoad(tex2DMS, vec2(_e25), 3); + let _e28 = textureLoad(tex2DMS, vec2(_e25), 3i); c_7 = _e28; return; } @@ -671,7 +671,7 @@ fn testTex2DMSArray(coord_24: vec3) { let _e26 = coord_25; let _e29 = coord_25; let _e30 = vec3(_e29); - let _e34 = textureLoad(tex2DMSArray, _e30.xy, _e30.z, 3); + let _e34 = textureLoad(tex2DMSArray, _e30.xy, _e30.z, 3i); c_8 = _e34; return; } diff --git a/naga/tests/out/wgsl/skybox.wgsl b/naga/tests/out/wgsl/skybox.wgsl index 73d4da78a4..0d82fe327f 100644 --- a/naga/tests/out/wgsl/skybox.wgsl +++ b/naga/tests/out/wgsl/skybox.wgsl @@ -20,8 +20,8 @@ fn vs_main(@builtin(vertex_index) vertex_index: u32) -> VertexOutput { var tmp1_: i32; var tmp2_: i32; - tmp1_ = (i32(vertex_index) / 2); - tmp2_ = (i32(vertex_index) & 1); + tmp1_ = (i32(vertex_index) / 2i); + tmp2_ = (i32(vertex_index) & 1i); let _e9 = tmp1_; let _e15 = tmp2_; let pos = vec4(((f32(_e9) * 4.0) - 1.0), ((f32(_e15) * 4.0) - 1.0), 0.0, 1.0); diff --git a/naga/tests/out/wgsl/workgroup-uniform-load.wgsl b/naga/tests/out/wgsl/workgroup-uniform-load.wgsl index 727ced8d6e..be85b033b9 100644 --- a/naga/tests/out/wgsl/workgroup-uniform-load.wgsl +++ b/naga/tests/out/wgsl/workgroup-uniform-load.wgsl @@ -6,7 +6,7 @@ var arr_i32_: array; fn test_workgroupUniformLoad(@builtin(workgroup_id) workgroup_id: vec3) { let x = (&arr_i32_[workgroup_id.x]); let _e4 = workgroupUniformLoad(x); - if (_e4 > 10) { + if (_e4 > 10i) { workgroupBarrier(); return; } else {