From 7624213c02d6c6314983ae53d124cbb3daa6d2e7 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Tue, 9 Nov 2021 09:24:41 -0500 Subject: [PATCH] Refactor namer scheme, fix trailing digits (#1510) --- src/proc/namer.rs | 104 ++- tests/out/glsl/access.atomics.Compute.glsl | 4 +- tests/out/glsl/access.foo.Vertex.glsl | 12 +- tests/out/glsl/interpolate.main.Fragment.glsl | 2 +- tests/out/glsl/interpolate.main.Vertex.glsl | 24 +- tests/out/glsl/operators.main.Compute.glsl | 4 +- tests/out/glsl/quad-vert.main.Vertex.glsl | 20 +- tests/out/glsl/quad.main.Fragment.glsl | 4 +- tests/out/glsl/skybox.fs_main.Fragment.glsl | 4 +- tests/out/hlsl/access.hlsl | 20 +- tests/out/hlsl/empty-global-name.hlsl | 19 + tests/out/hlsl/image.hlsl | 22 +- tests/out/hlsl/image.hlsl.config | 2 +- tests/out/hlsl/interface.hlsl | 26 +- tests/out/hlsl/interpolate.hlsl | 48 +- tests/out/hlsl/interpolate.hlsl.config | 2 +- .../hlsl/inv-hyperbolic-trig-functions.hlsl | 4 +- tests/out/hlsl/operators.hlsl | 4 +- tests/out/hlsl/quad-vert.hlsl | 28 +- tests/out/hlsl/quad.hlsl | 14 +- tests/out/hlsl/quad.hlsl.config | 2 +- tests/out/hlsl/shadow.hlsl | 8 +- tests/out/hlsl/skybox.hlsl | 12 +- tests/out/hlsl/standard.hlsl | 4 +- tests/out/msl/access.msl | 34 +- tests/out/msl/bits.msl | 2 +- tests/out/msl/boids.msl | 8 +- tests/out/msl/collatz.msl | 8 +- tests/out/msl/control-flow.msl | 4 +- tests/out/msl/empty-global-name.msl | 21 + tests/out/msl/empty.msl | 2 +- tests/out/msl/extra.msl | 14 +- tests/out/msl/globals.msl | 6 +- tests/out/msl/image.msl | 38 +- tests/out/msl/interface.msl | 34 +- tests/out/msl/interpolate.msl | 14 +- tests/out/msl/operators.msl | 6 +- tests/out/msl/quad-vert.msl | 46 +- tests/out/msl/quad.msl | 30 +- tests/out/msl/shadow.msl | 4 +- tests/out/msl/skybox.msl | 6 +- tests/out/msl/texture-arg.msl | 6 +- tests/out/wgsl/210-bevy-2d-shader-frag.wgsl | 8 +- tests/out/wgsl/210-bevy-2d-shader-vert.wgsl | 28 +- tests/out/wgsl/210-bevy-shader-vert.wgsl | 32 +- tests/out/wgsl/246-collatz-comp.wgsl | 20 +- tests/out/wgsl/277-casting-vert.wgsl | 4 +- tests/out/wgsl/280-matrix-cast-vert.wgsl | 4 +- tests/out/wgsl/484-preprocessor-if-vert.wgsl | 4 +- .../wgsl/800-out-of-bounds-panic-vert.wgsl | 20 +- tests/out/wgsl/896-push-constant-vert.wgsl | 4 +- .../wgsl/900-implicit-conversions-vert.wgsl | 52 +- tests/out/wgsl/901-lhs-field-select-vert.wgsl | 4 +- .../out/wgsl/931-constant-emitting-vert.wgsl | 6 +- tests/out/wgsl/932-for-loop-if-vert.wgsl | 4 +- tests/out/wgsl/access.wgsl | 18 +- tests/out/wgsl/bevy-pbr-frag.wgsl | 730 +++++++++--------- tests/out/wgsl/bevy-pbr-vert.wgsl | 38 +- tests/out/wgsl/bits_glsl-frag.wgsl | 4 +- tests/out/wgsl/bool-select-frag.wgsl | 32 +- tests/out/wgsl/clamp-splat-vert.wgsl | 10 +- tests/out/wgsl/constant-array-size-vert.wgsl | 6 +- tests/out/wgsl/empty-global-name-frag.wgsl | 4 +- tests/out/wgsl/empty-global-name.wgsl | 18 + tests/out/wgsl/expressions-frag.wgsl | 298 +++---- tests/out/wgsl/fma-frag.wgsl | 24 +- .../out/wgsl/global-constant-array-vert.wgsl | 4 +- tests/out/wgsl/image.wgsl | 20 +- tests/out/wgsl/interface.wgsl | 4 +- tests/out/wgsl/interpolate.wgsl | 2 +- .../wgsl/inv-hyperbolic-trig-functions.wgsl | 4 +- tests/out/wgsl/long-form-matrix-vert.wgsl | 4 +- tests/out/wgsl/math-functions-vert.wgsl | 4 +- tests/out/wgsl/operators.wgsl | 4 +- tests/out/wgsl/pointers.wgsl | 8 +- tests/out/wgsl/prepostfix-frag.wgsl | 24 +- tests/out/wgsl/quad-vert.wgsl | 16 +- tests/out/wgsl/quad.wgsl | 4 +- tests/out/wgsl/quad_glsl-frag.wgsl | 8 +- tests/out/wgsl/quad_glsl-vert.wgsl | 16 +- tests/out/wgsl/samplers-frag.wgsl | 568 +++++++------- tests/out/wgsl/swizzle_write-frag.wgsl | 4 +- 82 files changed, 1414 insertions(+), 1328 deletions(-) create mode 100644 tests/out/hlsl/empty-global-name.hlsl create mode 100644 tests/out/msl/empty-global-name.msl create mode 100644 tests/out/wgsl/empty-global-name.wgsl diff --git a/src/proc/namer.rs b/src/proc/namer.rs index ea1971c801..52ffd9eed9 100644 --- a/src/proc/namer.rs +++ b/src/proc/namer.rs @@ -1,7 +1,8 @@ use crate::{arena::Handle, FastHashMap, FastHashSet}; -use std::collections::hash_map::Entry; +use std::borrow::Cow; pub type EntryPointIndex = u16; +const SEPARATOR: char = '_'; #[derive(Debug, Eq, Hash, PartialEq)] pub enum NameKey { @@ -30,26 +31,40 @@ pub struct Namer { impl Namer { /// Return a form of `string` suitable for use as the base of an identifier. /// - /// Retain only alphanumeric and `_` characters. Drop leading digits. Ensure - /// that the string does not end with a digit, so we can attach numeric - /// suffixes without merging. Avoid prefixes in - /// [`Namer::reserved_prefixes`]. - fn sanitize(&self, string: &str) -> String { - let mut base = string - .chars() - .skip_while(|&c| c.is_numeric() || c == '_') - .filter(|&c| c.is_ascii_alphanumeric() || c == '_') - .collect::(); - // close the name by '_' if the re is a number, so that - // we can have our own number! - match base.chars().next_back() { - Some(c) if !c.is_numeric() => {} - _ => base.push('_'), + /// - Drop leading digits. + /// - Retain only alphanumeric and `_` characters. + /// - Avoid prefixes in [`Namer::reserved_prefixes`]. + /// + /// The return value is a valid identifier prefix in all of Naga's output languages, + /// and it never ends with a `SEPARATOR` character. + /// It is used as a key into the unique table. + fn sanitize<'s>(&self, string: &'s str) -> Cow<'s, str> { + let string = string + .trim_start_matches(|c: char| c.is_numeric()) + .trim_end_matches(SEPARATOR); + + let base = if !string.is_empty() + && string + .chars() + .all(|c: char| c.is_ascii_alphanumeric() || c == '_') + { + Cow::Borrowed(string) + } else { + let mut filtered = string + .chars() + .filter(|&c| c.is_ascii_alphanumeric() || c == '_') + .collect::(); + let stripped_len = filtered.trim_end_matches(SEPARATOR).len(); + filtered.truncate(stripped_len); + if filtered.is_empty() { + filtered.push_str("unnamed"); + } + Cow::Owned(filtered) }; for prefix in &self.reserved_prefixes { if base.starts_with(prefix) { - return format!("gen_{}", base); + return Cow::Owned(format!("gen_{}", base)); } } @@ -66,36 +81,41 @@ impl Namer { /// /// Guarantee uniqueness by applying a numeric suffix when necessary. pub fn call(&mut self, label_raw: &str) -> String { + use std::fmt::Write as _; // for write!-ing to Strings + let base = self.sanitize(label_raw); - match self.unique.entry(base) { - Entry::Occupied(mut e) => { - *e.get_mut() += 1; - format!("{}{}", e.key(), e.get()) + debug_assert!(!base.is_empty() && !base.ends_with(SEPARATOR)); + + // This would seem to be a natural place to use `HashMap::entry`. However, `entry` + // requires an owned key, and we'd like to avoid heap-allocating strings we're + // just going to throw away. The approach below double-hashes only when we create + // a new entry, in which case the heap allocation of the owned key was more + // expensive anyway. + match self.unique.get_mut(base.as_ref()) { + Some(count) => { + *count += 1; + // Add the suffix. This may fit in base's existing allocation. + let mut suffixed = base.into_owned(); + write!(&mut suffixed, "{}{}", SEPARATOR, *count).unwrap(); + suffixed } - Entry::Vacant(e) => { - let name = e.key(); - if self.keywords.contains(e.key()) { - let name = format!("{}1", name); - e.insert(1); - name - } else { - let name = name.to_string(); - e.insert(0); - name + None => { + let mut suffixed = base.to_string(); + if base.ends_with(char::is_numeric) || self.keywords.contains(base.as_ref()) { + suffixed.push(SEPARATOR); } + debug_assert!(!self.keywords.contains(&suffixed)); + // `self.unique` wants to own its keys. This allocates only if we haven't + // already done so earlier. + self.unique.insert(base.into_owned(), 0); + suffixed } } } pub fn call_or(&mut self, label: &Option, fallback: &str) -> String { self.call(match *label { - Some(ref name) => { - if name.trim().is_empty() { - fallback - } else { - name - } - } + Some(ref name) => name, None => fallback, }) } @@ -230,3 +250,11 @@ impl Namer { } } } + +#[test] +fn test() { + let mut namer = Namer::default(); + assert_eq!(namer.call("x"), "x"); + assert_eq!(namer.call("x"), "x_1"); + assert_eq!(namer.call("x1"), "x1_"); +} diff --git a/tests/out/glsl/access.atomics.Compute.glsl b/tests/out/glsl/access.atomics.Compute.glsl index 81eb83e53e..0145ad4981 100644 --- a/tests/out/glsl/access.atomics.Compute.glsl +++ b/tests/out/glsl/access.atomics.Compute.glsl @@ -13,8 +13,8 @@ layout(std430) buffer Bar_block_0Cs { } _group_0_binding_0; -float read_from_private(inout float foo2) { - float _e2 = foo2; +float read_from_private(inout float foo_2) { + float _e2 = foo_2; return _e2; } diff --git a/tests/out/glsl/access.foo.Vertex.glsl b/tests/out/glsl/access.foo.Vertex.glsl index 848bce8cdb..d4502b0313 100644 --- a/tests/out/glsl/access.foo.Vertex.glsl +++ b/tests/out/glsl/access.foo.Vertex.glsl @@ -11,22 +11,22 @@ layout(std430) buffer Bar_block_0Vs { } _group_0_binding_0; -float read_from_private(inout float foo2) { - float _e2 = foo2; +float read_from_private(inout float foo_2) { + float _e2 = foo_2; return _e2; } void main() { uint vi = uint(gl_VertexID); - float foo1 = 0.0; + float foo_1 = 0.0; int c[5]; - float baz = foo1; - foo1 = 1.0; + float baz = foo_1; + foo_1 = 1.0; mat4x4 matrix = _group_0_binding_0.matrix; uvec2 arr[2] = _group_0_binding_0.arr; float b = _group_0_binding_0.matrix[3][0]; int a = _group_0_binding_0.data[(uint(_group_0_binding_0.data.length()) - 2u)]; - float _e25 = read_from_private(foo1); + float _e25 = read_from_private(foo_1); _group_0_binding_0.matrix[1][2] = 1.0; _group_0_binding_0.matrix = mat4x4(vec4(0.0), vec4(1.0), vec4(2.0), vec4(3.0)); _group_0_binding_0.arr = uvec2[2](uvec2(0u), uvec2(1u)); diff --git a/tests/out/glsl/interpolate.main.Fragment.glsl b/tests/out/glsl/interpolate.main.Fragment.glsl index b415997304..918e78b9cf 100644 --- a/tests/out/glsl/interpolate.main.Fragment.glsl +++ b/tests/out/glsl/interpolate.main.Fragment.glsl @@ -1,7 +1,7 @@ #version 400 core struct FragmentInput { vec4 position; - uint flat1; + uint flat_; float linear; vec2 linear_centroid; vec3 linear_sample; diff --git a/tests/out/glsl/interpolate.main.Vertex.glsl b/tests/out/glsl/interpolate.main.Vertex.glsl index 76cdd0ac02..40d64ccf0d 100644 --- a/tests/out/glsl/interpolate.main.Vertex.glsl +++ b/tests/out/glsl/interpolate.main.Vertex.glsl @@ -1,7 +1,7 @@ #version 400 core struct FragmentInput { vec4 position; - uint flat1; + uint flat_; float linear; vec2 linear_centroid; vec3 linear_sample; @@ -19,18 +19,18 @@ smooth centroid out float _vs2fs_location5; smooth sample out float _vs2fs_location6; void main() { - FragmentInput out1; - out1.position = vec4(2.0, 4.0, 5.0, 6.0); - out1.flat1 = 8u; - out1.linear = 27.0; - out1.linear_centroid = vec2(64.0, 125.0); - out1.linear_sample = vec3(216.0, 343.0, 512.0); - out1.perspective = vec4(729.0, 1000.0, 1331.0, 1728.0); - out1.perspective_centroid = 2197.0; - out1.perspective_sample = 2744.0; - FragmentInput _e30 = out1; + FragmentInput out_; + out_.position = vec4(2.0, 4.0, 5.0, 6.0); + out_.flat_ = 8u; + out_.linear = 27.0; + out_.linear_centroid = vec2(64.0, 125.0); + out_.linear_sample = vec3(216.0, 343.0, 512.0); + out_.perspective = vec4(729.0, 1000.0, 1331.0, 1728.0); + out_.perspective_centroid = 2197.0; + out_.perspective_sample = 2744.0; + FragmentInput _e30 = out_; gl_Position = _e30.position; - _vs2fs_location0 = _e30.flat1; + _vs2fs_location0 = _e30.flat_; _vs2fs_location1 = _e30.linear; _vs2fs_location2 = _e30.linear_centroid; _vs2fs_location3 = _e30.linear_sample; diff --git a/tests/out/glsl/operators.main.Compute.glsl b/tests/out/glsl/operators.main.Compute.glsl index a135e6c4d3..ac6ecfa628 100644 --- a/tests/out/glsl/operators.main.Compute.glsl +++ b/tests/out/glsl/operators.main.Compute.glsl @@ -50,8 +50,8 @@ float constructors() { } void modulo() { - int a1 = (1 % 1); - float b1 = (1.0 - 1.0 * trunc(1.0 / 1.0)); + int a_1 = (1 % 1); + float b_1 = (1.0 - 1.0 * trunc(1.0 / 1.0)); ivec3 c = (ivec3(1) % ivec3(1)); vec3 d = (vec3(1.0) - vec3(1.0) * trunc(vec3(1.0) / vec3(1.0))); } diff --git a/tests/out/glsl/quad-vert.main.Vertex.glsl b/tests/out/glsl/quad-vert.main.Vertex.glsl index d873765dd9..26df417673 100644 --- a/tests/out/glsl/quad-vert.main.Vertex.glsl +++ b/tests/out/glsl/quad-vert.main.Vertex.glsl @@ -3,14 +3,14 @@ precision highp float; precision highp int; -struct type9 { +struct type_9 { vec2 member; vec4 gen_gl_Position; }; vec2 v_uv = vec2(0.0, 0.0); -vec2 a_uv1 = vec2(0.0, 0.0); +vec2 a_uv_1 = vec2(0.0, 0.0); struct gen_gl_PerVertex_block_0Vs { vec4 gen_gl_Position; @@ -19,16 +19,16 @@ struct gen_gl_PerVertex_block_0Vs { float gen_gl_CullDistance[1]; } perVertexStruct; -vec2 a_pos1 = vec2(0.0, 0.0); +vec2 a_pos_1 = vec2(0.0, 0.0); layout(location = 1) in vec2 _p2vs_location1; layout(location = 0) in vec2 _p2vs_location0; layout(location = 0) smooth out vec2 _vs2fs_location0; -void main2() { - vec2 _e12 = a_uv1; +void main_1() { + vec2 _e12 = a_uv_1; v_uv = _e12; - vec2 _e13 = a_pos1; + vec2 _e13 = a_pos_1; perVertexStruct.gen_gl_Position = vec4(_e13.x, _e13.y, 0.0, 1.0); return; } @@ -36,12 +36,12 @@ void main2() { void main() { vec2 a_uv = _p2vs_location1; vec2 a_pos = _p2vs_location0; - a_uv1 = a_uv; - a_pos1 = a_pos; - main2(); + a_uv_1 = a_uv; + a_pos_1 = a_pos; + main_1(); vec2 _e7 = v_uv; vec4 _e8 = perVertexStruct.gen_gl_Position; - type9 _tmp_return = type9(_e7, _e8); + type_9 _tmp_return = type_9(_e7, _e8); _vs2fs_location0 = _tmp_return.member; gl_Position = _tmp_return.gen_gl_Position; gl_Position.yz = vec2(-gl_Position.y, gl_Position.z * 2.0 - gl_Position.w); diff --git a/tests/out/glsl/quad.main.Fragment.glsl b/tests/out/glsl/quad.main.Fragment.glsl index 6b03a6515c..b290ed5a0e 100644 --- a/tests/out/glsl/quad.main.Fragment.glsl +++ b/tests/out/glsl/quad.main.Fragment.glsl @@ -14,8 +14,8 @@ smooth in vec2 _vs2fs_location0; layout(location = 0) out vec4 _fs2p_location0; void main() { - vec2 uv1 = _vs2fs_location0; - vec4 color = texture(_group_0_binding_0, vec2(uv1)); + vec2 uv_1 = _vs2fs_location0; + vec4 color = texture(_group_0_binding_0, vec2(uv_1)); if ((color.w == 0.0)) { discard; } diff --git a/tests/out/glsl/skybox.fs_main.Fragment.glsl b/tests/out/glsl/skybox.fs_main.Fragment.glsl index fa0b46f024..08b733b848 100644 --- a/tests/out/glsl/skybox.fs_main.Fragment.glsl +++ b/tests/out/glsl/skybox.fs_main.Fragment.glsl @@ -14,8 +14,8 @@ layout(location = 0) smooth in vec3 _vs2fs_location0; layout(location = 0) out vec4 _fs2p_location0; void main() { - VertexOutput in1 = VertexOutput(gl_FragCoord, _vs2fs_location0); - vec4 _e5 = texture(_group_0_binding_1, vec3(in1.uv)); + VertexOutput in_ = VertexOutput(gl_FragCoord, _vs2fs_location0); + vec4 _e5 = texture(_group_0_binding_1, vec3(in_.uv)); _fs2p_location0 = _e5; return; } diff --git a/tests/out/hlsl/access.hlsl b/tests/out/hlsl/access.hlsl index 22f27b8814..91b15a93c5 100644 --- a/tests/out/hlsl/access.hlsl +++ b/tests/out/hlsl/access.hlsl @@ -1,9 +1,9 @@ RWByteAddressBuffer bar : register(u0); -float read_from_private(inout float foo2) +float read_from_private(inout float foo_2) { - float _expr2 = foo2; + float _expr2 = foo_2; return _expr2; } @@ -16,16 +16,16 @@ uint NagaBufferLengthRW(RWByteAddressBuffer buffer) float4 foo(uint vi : SV_VertexID) : SV_Position { - float foo1 = 0.0; + float foo_1 = 0.0; int c[5] = {(int)0,(int)0,(int)0,(int)0,(int)0}; - float baz = foo1; - foo1 = 1.0; - float4x4 matrix1 = float4x4(asfloat(bar.Load4(0+0)), asfloat(bar.Load4(0+16)), asfloat(bar.Load4(0+32)), asfloat(bar.Load4(0+48))); + float baz = foo_1; + foo_1 = 1.0; + float4x4 matrix_ = float4x4(asfloat(bar.Load4(0+0)), asfloat(bar.Load4(0+16)), asfloat(bar.Load4(0+32)), asfloat(bar.Load4(0+48))); uint2 arr[2] = {asuint(bar.Load2(72+0)), asuint(bar.Load2(72+8))}; float b = asfloat(bar.Load(0+48+0)); int a = asint(bar.Load((((NagaBufferLengthRW(bar) - 88) / 8) - 2u)*8+88)); - const float _e25 = read_from_private(foo1); + const float _e25 = read_from_private(foo_1); bar.Store(8+16+0, asuint(1.0)); { float4x4 _value2 = float4x4(float4(0.0.xxxx), float4(1.0.xxxx), float4(2.0.xxxx), float4(3.0.xxxx)); @@ -46,7 +46,7 @@ float4 foo(uint vi : SV_VertexID) : SV_Position } c[(vi + 1u)] = 42; int value = c[vi]; - return mul(float4(int4(value.xxxx)), matrix1); + return mul(float4(int4(value.xxxx)), matrix_); } [numthreads(1, 1, 1)] @@ -54,7 +54,7 @@ void atomics() { int tmp = (int)0; - int value1 = asint(bar.Load(64)); + int value_1 = asint(bar.Load(64)); int _e6; bar.InterlockedAdd(64, 5, _e6); tmp = _e6; int _e9; bar.InterlockedAdd(64, -5, _e9); @@ -71,6 +71,6 @@ void atomics() tmp = _e24; int _e27; bar.InterlockedExchange(64, 5, _e27); tmp = _e27; - bar.Store(64, asuint(value1)); + bar.Store(64, asuint(value_1)); return; } diff --git a/tests/out/hlsl/empty-global-name.hlsl b/tests/out/hlsl/empty-global-name.hlsl new file mode 100644 index 0000000000..18c5831de2 --- /dev/null +++ b/tests/out/hlsl/empty-global-name.hlsl @@ -0,0 +1,19 @@ + +struct type_1 { + int member; +}; + +RWByteAddressBuffer unnamed : register(u0); + +void function() +{ + int _expr8 = asint(unnamed.Load(0)); + unnamed.Store(0, asuint((_expr8 + 1))); + return; +} + +[numthreads(64, 1, 1)] +void main() +{ + function(); +} diff --git a/tests/out/hlsl/image.hlsl b/tests/out/hlsl/image.hlsl index d6da396a5b..796c748411 100644 --- a/tests/out/hlsl/image.hlsl +++ b/tests/out/hlsl/image.hlsl @@ -38,12 +38,12 @@ void main(uint3 local_id : SV_GroupThreadID) } [numthreads(16, 1, 1)] -void depth_load(uint3 local_id1 : SV_GroupThreadID) +void depth_load(uint3 local_id_1 : SV_GroupThreadID) { - int2 dim1 = NagaRWDimensions2D(image_storage_src); - int2 itc1 = ((dim1 * int2(local_id1.xy)) % int2(10, 20)); - float val = image_depth_multisampled_src.Load(itc1, int(local_id1.z)).x; - image_dst[itc1.x] = uint4(uint(val).xxxx); + int2 dim_1 = NagaRWDimensions2D(image_storage_src); + int2 itc_1 = ((dim_1 * int2(local_id_1.xy)) % int2(10, 20)); + float val = image_depth_multisampled_src.Load(itc_1, int(local_id_1.z)).x; + image_dst[itc_1.x] = uint4(uint(val).xxxx); return; } @@ -207,11 +207,11 @@ float4 levels_queries() : SV_Position int num_layers_cube = NagaNumLayersCubeArray(image_cube_array); int num_levels_3d = NagaNumLevels3D(image_3d); int num_samples_aa = NagaMSNumSamples2D(image_aa); - int sum1 = (((((((num_layers_2d + num_layers_cube) + num_samples_aa) + num_levels_2d) + num_levels_2d_array) + num_levels_3d) + num_levels_cube) + num_levels_cube_array); - return float4(float(sum1).xxxx); + int sum_1 = (((((((num_layers_2d + num_layers_cube) + num_samples_aa) + num_levels_2d) + num_levels_2d_array) + num_levels_3d) + num_levels_cube) + num_levels_cube_array); + return float4(float(sum_1).xxxx); } -float4 sample1() : SV_Target0 +float4 sample_() : SV_Target0 { float2 tc = float2(0.5.xx); float4 s1d = image_1d.Sample(sampler_reg, tc.x); @@ -224,8 +224,8 @@ float4 sample1() : SV_Target0 float sample_comparison() : SV_Target0 { - float2 tc1 = float2(0.5.xx); - float s2d_depth = image_2d_depth.SampleCmp(sampler_cmp, tc1, 0.5); - float s2d_depth_level = image_2d_depth.SampleCmpLevelZero(sampler_cmp, tc1, 0.5); + float2 tc_1 = float2(0.5.xx); + float s2d_depth = image_2d_depth.SampleCmp(sampler_cmp, tc_1, 0.5); + float s2d_depth_level = image_2d_depth.SampleCmpLevelZero(sampler_cmp, tc_1, 0.5); return (s2d_depth + s2d_depth_level); } diff --git a/tests/out/hlsl/image.hlsl.config b/tests/out/hlsl/image.hlsl.config index 4f6c8ecdbc..28af7d931d 100644 --- a/tests/out/hlsl/image.hlsl.config +++ b/tests/out/hlsl/image.hlsl.config @@ -1,3 +1,3 @@ vertex=(queries:vs_5_1 levels_queries:vs_5_1 ) -fragment=(sample1:ps_5_1 sample_comparison:ps_5_1 ) +fragment=(sample_:ps_5_1 sample_comparison:ps_5_1 ) compute=(main:cs_5_1 depth_load:cs_5_1 ) diff --git a/tests/out/hlsl/interface.hlsl b/tests/out/hlsl/interface.hlsl index 38d6cb820a..99ed31acd5 100644 --- a/tests/out/hlsl/interface.hlsl +++ b/tests/out/hlsl/interface.hlsl @@ -24,11 +24,11 @@ struct VertexOutput_vertex { }; struct FragmentInput_fragment { - float varying1 : LOC1; - float4 position1 : SV_Position; - bool front_facing1 : SV_IsFrontFace; - uint sample_index1 : SV_SampleIndex; - uint sample_mask1 : SV_Coverage; + float varying_1 : LOC1; + float4 position_1 : SV_Position; + bool front_facing_1 : SV_IsFrontFace; + uint sample_index_1 : SV_SampleIndex; + uint sample_mask_1 : SV_Coverage; }; VertexOutput ConstructVertexOutput(float4 arg0, float arg1) { @@ -42,8 +42,8 @@ VertexOutput_vertex vertex(uint vertex_index : SV_VertexID, uint instance_index { uint tmp = (((_NagaConstants.base_vertex + vertex_index) + (_NagaConstants.base_instance + instance_index)) + color); const VertexOutput vertexoutput = ConstructVertexOutput(float4(1.0.xxxx), float(tmp)); - const VertexOutput_vertex vertexoutput1 = { vertexoutput.varying, vertexoutput.position }; - return vertexoutput1; + const VertexOutput_vertex vertexoutput_1 = { vertexoutput.varying, vertexoutput.position }; + return vertexoutput_1; } FragmentOutput ConstructFragmentOutput(float arg0, uint arg1, float arg2) { @@ -56,13 +56,13 @@ FragmentOutput ConstructFragmentOutput(float arg0, uint arg1, float arg2) { FragmentOutput fragment(FragmentInput_fragment fragmentinput_fragment) { - VertexOutput in1 = { fragmentinput_fragment.position1, fragmentinput_fragment.varying1 }; - bool front_facing = fragmentinput_fragment.front_facing1; - uint sample_index = fragmentinput_fragment.sample_index1; - uint sample_mask = fragmentinput_fragment.sample_mask1; + VertexOutput in_ = { fragmentinput_fragment.position_1, fragmentinput_fragment.varying_1 }; + bool front_facing = fragmentinput_fragment.front_facing_1; + uint sample_index = fragmentinput_fragment.sample_index_1; + uint sample_mask = fragmentinput_fragment.sample_mask_1; uint mask = (sample_mask & (1u << sample_index)); - float color1 = (front_facing ? 1.0 : 0.0); - const FragmentOutput fragmentoutput = ConstructFragmentOutput(in1.varying, mask, color1); + float color_1 = (front_facing ? 1.0 : 0.0); + const FragmentOutput fragmentoutput = ConstructFragmentOutput(in_.varying, mask, color_1); return fragmentoutput; } diff --git a/tests/out/hlsl/interpolate.hlsl b/tests/out/hlsl/interpolate.hlsl index 788542e9e2..7372b0f81a 100644 --- a/tests/out/hlsl/interpolate.hlsl +++ b/tests/out/hlsl/interpolate.hlsl @@ -2,7 +2,7 @@ struct FragmentInput { float4 position : SV_Position; nointerpolation uint flat : LOC0; - noperspective float linear1 : LOC1; + noperspective float linear_ : LOC1; noperspective centroid float2 linear_centroid : LOC2; noperspective sample float3 linear_sample : LOC3; linear float4 perspective : LOC4; @@ -12,7 +12,7 @@ struct FragmentInput { struct VertexOutput_main { uint flat : LOC0; - float linear1 : LOC1; + float linear_ : LOC1; float2 linear_centroid : LOC2; float3 linear_sample : LOC3; float4 perspective : LOC4; @@ -22,36 +22,36 @@ struct VertexOutput_main { }; struct FragmentInput_main { - uint flat1 : LOC0; - float linear2 : LOC1; - float2 linear_centroid1 : LOC2; - float3 linear_sample1 : LOC3; - float4 perspective1 : LOC4; - float perspective_centroid1 : LOC5; - float perspective_sample1 : LOC6; - float4 position1 : SV_Position; + uint flat_1 : LOC0; + float linear_1 : LOC1; + float2 linear_centroid_1 : LOC2; + float3 linear_sample_1 : LOC3; + float4 perspective_1 : LOC4; + float perspective_centroid_1 : LOC5; + float perspective_sample_1 : LOC6; + float4 position_1 : SV_Position; }; VertexOutput_main main() { - FragmentInput out1 = (FragmentInput)0; + FragmentInput out_ = (FragmentInput)0; - out1.position = float4(2.0, 4.0, 5.0, 6.0); - out1.flat = 8u; - out1.linear1 = 27.0; - out1.linear_centroid = float2(64.0, 125.0); - out1.linear_sample = float3(216.0, 343.0, 512.0); - out1.perspective = float4(729.0, 1000.0, 1331.0, 1728.0); - out1.perspective_centroid = 2197.0; - out1.perspective_sample = 2744.0; - FragmentInput _expr30 = out1; + out_.position = float4(2.0, 4.0, 5.0, 6.0); + out_.flat = 8u; + out_.linear_ = 27.0; + out_.linear_centroid = float2(64.0, 125.0); + out_.linear_sample = float3(216.0, 343.0, 512.0); + out_.perspective = float4(729.0, 1000.0, 1331.0, 1728.0); + out_.perspective_centroid = 2197.0; + out_.perspective_sample = 2744.0; + FragmentInput _expr30 = out_; const FragmentInput fragmentinput = _expr30; - const VertexOutput_main fragmentinput1 = { fragmentinput.flat, fragmentinput.linear1, fragmentinput.linear_centroid, fragmentinput.linear_sample, fragmentinput.perspective, fragmentinput.perspective_centroid, fragmentinput.perspective_sample, fragmentinput.position }; - return fragmentinput1; + const VertexOutput_main fragmentinput_1 = { fragmentinput.flat, fragmentinput.linear_, fragmentinput.linear_centroid, fragmentinput.linear_sample, fragmentinput.perspective, fragmentinput.perspective_centroid, fragmentinput.perspective_sample, fragmentinput.position }; + return fragmentinput_1; } -void main1(FragmentInput_main fragmentinput_main) +void main_1(FragmentInput_main fragmentinput_main) { - FragmentInput val = { fragmentinput_main.position1, fragmentinput_main.flat1, fragmentinput_main.linear2, fragmentinput_main.linear_centroid1, fragmentinput_main.linear_sample1, fragmentinput_main.perspective1, fragmentinput_main.perspective_centroid1, fragmentinput_main.perspective_sample1 }; + FragmentInput val = { fragmentinput_main.position_1, fragmentinput_main.flat_1, fragmentinput_main.linear_1, fragmentinput_main.linear_centroid_1, fragmentinput_main.linear_sample_1, fragmentinput_main.perspective_1, fragmentinput_main.perspective_centroid_1, fragmentinput_main.perspective_sample_1 }; return; } diff --git a/tests/out/hlsl/interpolate.hlsl.config b/tests/out/hlsl/interpolate.hlsl.config index b0a8e4ba9c..5a8cb0c2ea 100644 --- a/tests/out/hlsl/interpolate.hlsl.config +++ b/tests/out/hlsl/interpolate.hlsl.config @@ -1,3 +1,3 @@ vertex=(main:vs_5_1 ) -fragment=(main1:ps_5_1 ) +fragment=(main_1:ps_5_1 ) compute=() diff --git a/tests/out/hlsl/inv-hyperbolic-trig-functions.hlsl b/tests/out/hlsl/inv-hyperbolic-trig-functions.hlsl index 5857257ffa..23fdc45f47 100644 --- a/tests/out/hlsl/inv-hyperbolic-trig-functions.hlsl +++ b/tests/out/hlsl/inv-hyperbolic-trig-functions.hlsl @@ -1,7 +1,7 @@ static float a = (float)0; -void main1() +void main_1() { float b = (float)0; float c = (float)0; @@ -18,5 +18,5 @@ void main1() void main() { - main1(); + main_1(); } diff --git a/tests/out/hlsl/operators.hlsl b/tests/out/hlsl/operators.hlsl index 0f6a23e307..1e35bb0a9b 100644 --- a/tests/out/hlsl/operators.hlsl +++ b/tests/out/hlsl/operators.hlsl @@ -61,8 +61,8 @@ float constructors() void modulo() { - int a1 = (1 % 1); - float b1 = (1.0 % 1.0); + int a_1 = (1 % 1); + float b_1 = (1.0 % 1.0); int3 c = (int3(1.xxx) % int3(1.xxx)); float3 d = (float3(1.0.xxx) % float3(1.0.xxx)); } diff --git a/tests/out/hlsl/quad-vert.hlsl b/tests/out/hlsl/quad-vert.hlsl index 271cbb2734..7b926b1067 100644 --- a/tests/out/hlsl/quad-vert.hlsl +++ b/tests/out/hlsl/quad-vert.hlsl @@ -6,32 +6,32 @@ struct gl_PerVertex { float gl_CullDistance[1] : SV_CullDistance; }; -struct type9 { +struct type_9 { linear float2 member : LOC0; float4 gl_Position : SV_Position; }; static float2 v_uv = (float2)0; -static float2 a_uv1 = (float2)0; +static float2 a_uv_1 = (float2)0; static gl_PerVertex perVertexStruct = { float4(0.0, 0.0, 0.0, 1.0), 1.0, { 0.0 }, { 0.0 } }; -static float2 a_pos1 = (float2)0; +static float2 a_pos_1 = (float2)0; struct VertexOutput_main { float2 member : LOC0; float4 gl_Position : SV_Position; }; -void main1() +void main_1() { - float2 _expr12 = a_uv1; + float2 _expr12 = a_uv_1; v_uv = _expr12; - float2 _expr13 = a_pos1; + float2 _expr13 = a_pos_1; perVertexStruct.gl_Position = float4(_expr13.x, _expr13.y, 0.0, 1.0); return; } -type9 Constructtype9(float2 arg0, float4 arg1) { - type9 ret; +type_9 Constructtype_9(float2 arg0, float4 arg1) { + type_9 ret; ret.member = arg0; ret.gl_Position = arg1; return ret; @@ -39,12 +39,12 @@ type9 Constructtype9(float2 arg0, float4 arg1) { VertexOutput_main main(float2 a_uv : LOC1, float2 a_pos : LOC0) { - a_uv1 = a_uv; - a_pos1 = a_pos; - main1(); + a_uv_1 = a_uv; + a_pos_1 = a_pos; + main_1(); float2 _expr7 = v_uv; float4 _expr8 = perVertexStruct.gl_Position; - const type9 type9_ = Constructtype9(_expr7, _expr8); - const VertexOutput_main type9_1 = { type9_.member, type9_.gl_Position }; - return type9_1; + const type_9 type_9_ = Constructtype_9(_expr7, _expr8); + const VertexOutput_main type_9_1 = { type_9_.member, type_9_.gl_Position }; + return type_9_1; } diff --git a/tests/out/hlsl/quad.hlsl b/tests/out/hlsl/quad.hlsl index cde665800a..1a6c3caafe 100644 --- a/tests/out/hlsl/quad.hlsl +++ b/tests/out/hlsl/quad.hlsl @@ -9,12 +9,12 @@ Texture2D u_texture : register(t0); SamplerState u_sampler : register(s1); struct VertexOutput_main { - float2 uv2 : LOC0; + float2 uv_2 : LOC0; float4 position : SV_Position; }; struct FragmentInput_main { - float2 uv3 : LOC0; + float2 uv_3 : LOC0; }; VertexOutput ConstructVertexOutput(float2 arg0, float4 arg1) { @@ -27,14 +27,14 @@ VertexOutput ConstructVertexOutput(float2 arg0, float4 arg1) { VertexOutput_main main(float2 pos : LOC0, float2 uv : LOC1) { const VertexOutput vertexoutput = ConstructVertexOutput(uv, float4((c_scale * pos), 0.0, 1.0)); - const VertexOutput_main vertexoutput1 = { vertexoutput.uv, vertexoutput.position }; - return vertexoutput1; + const VertexOutput_main vertexoutput_1 = { vertexoutput.uv, vertexoutput.position }; + return vertexoutput_1; } -float4 main1(FragmentInput_main fragmentinput_main) : SV_Target0 +float4 main_1(FragmentInput_main fragmentinput_main) : SV_Target0 { - float2 uv1 = fragmentinput_main.uv3; - float4 color = u_texture.Sample(u_sampler, uv1); + float2 uv_1 = fragmentinput_main.uv_3; + float4 color = u_texture.Sample(u_sampler, uv_1); if ((color.w == 0.0)) { discard; } diff --git a/tests/out/hlsl/quad.hlsl.config b/tests/out/hlsl/quad.hlsl.config index 24b516da9e..7678a4e571 100644 --- a/tests/out/hlsl/quad.hlsl.config +++ b/tests/out/hlsl/quad.hlsl.config @@ -1,3 +1,3 @@ vertex=(main:vs_5_1 ) -fragment=(main1:ps_5_1 fs_extra:ps_5_1 ) +fragment=(main_1:ps_5_1 fs_extra:ps_5_1 ) compute=() diff --git a/tests/out/hlsl/shadow.hlsl b/tests/out/hlsl/shadow.hlsl index 37fdef90ac..e0d509c72c 100644 --- a/tests/out/hlsl/shadow.hlsl +++ b/tests/out/hlsl/shadow.hlsl @@ -17,8 +17,8 @@ Texture2DArray t_shadow : register(t2); SamplerComparisonState sampler_shadow : register(s3); struct FragmentInput_fs_main { - float3 raw_normal1 : LOC0; - float4 position1 : LOC1; + float3 raw_normal_1 : LOC0; + float4 position_1 : LOC1; }; float fetch_shadow(uint light_id, float4 homogeneous_coords) @@ -34,8 +34,8 @@ float fetch_shadow(uint light_id, float4 homogeneous_coords) float4 fs_main(FragmentInput_fs_main fragmentinput_fs_main) : SV_Target0 { - float3 raw_normal = fragmentinput_fs_main.raw_normal1; - float4 position = fragmentinput_fs_main.position1; + float3 raw_normal = fragmentinput_fs_main.raw_normal_1; + float4 position = fragmentinput_fs_main.position_1; float3 color = float3(0.05000000074505806, 0.05000000074505806, 0.05000000074505806); uint i = 0u; diff --git a/tests/out/hlsl/skybox.hlsl b/tests/out/hlsl/skybox.hlsl index 0120ff7fb8..3988369cf5 100644 --- a/tests/out/hlsl/skybox.hlsl +++ b/tests/out/hlsl/skybox.hlsl @@ -25,8 +25,8 @@ struct VertexOutput_vs_main { }; struct FragmentInput_fs_main { - float3 uv1 : LOC0; - float4 position1 : SV_Position; + float3 uv_1 : LOC0; + float4 position_1 : SV_Position; }; VertexOutput ConstructVertexOutput(float4 arg0, float3 arg1) { @@ -53,13 +53,13 @@ VertexOutput_vs_main vs_main(uint vertex_index : SV_VertexID) float4x4 _expr40 = r_data.proj_inv; float4 unprojected = mul(pos, _expr40); const VertexOutput vertexoutput = ConstructVertexOutput(pos, mul(unprojected.xyz, inv_model_view)); - const VertexOutput_vs_main vertexoutput1 = { vertexoutput.uv, vertexoutput.position }; - return vertexoutput1; + const VertexOutput_vs_main vertexoutput_1 = { vertexoutput.uv, vertexoutput.position }; + return vertexoutput_1; } float4 fs_main(FragmentInput_fs_main fragmentinput_fs_main) : SV_Target0 { - VertexOutput in1 = { fragmentinput_fs_main.position1, fragmentinput_fs_main.uv1 }; - float4 _expr5 = r_texture.Sample(r_sampler, in1.uv); + VertexOutput in_ = { fragmentinput_fs_main.position_1, fragmentinput_fs_main.uv_1 }; + float4 _expr5 = r_texture.Sample(r_sampler, in_.uv); return _expr5; } diff --git a/tests/out/hlsl/standard.hlsl b/tests/out/hlsl/standard.hlsl index e70e87f575..e4077b5f04 100644 --- a/tests/out/hlsl/standard.hlsl +++ b/tests/out/hlsl/standard.hlsl @@ -1,11 +1,11 @@ struct FragmentInput_derivatives { - float4 foo1 : SV_Position; + float4 foo_1 : SV_Position; }; float4 derivatives(FragmentInput_derivatives fragmentinput_derivatives) : SV_Target0 { - float4 foo = fragmentinput_derivatives.foo1; + float4 foo = fragmentinput_derivatives.foo_1; float4 x = ddx(foo); float4 y = ddy(foo); float4 z = fwidth(foo); diff --git a/tests/out/msl/access.msl b/tests/out/msl/access.msl index 884e606b32..fda0a32019 100644 --- a/tests/out/msl/access.msl +++ b/tests/out/msl/access.msl @@ -6,25 +6,25 @@ struct _mslBufferSizes { metal::uint size0; }; -struct type3 { +struct type_3 { metal::uint2 inner[2]; }; -typedef int type5[1]; +typedef int type_5[1]; struct Bar { metal::float4x4 matrix; metal::atomic_int atom; char _pad2[4]; - type3 arr; - type5 data; + type_3 arr; + type_5 data; }; -struct type11 { +struct type_11 { int inner[5]; }; float read_from_private( - thread float& foo2 + thread float& foo_2 ) { - float _e2 = foo2; + float _e2 = foo_2; return _e2; } @@ -38,20 +38,20 @@ vertex fooOutput foo( , device Bar& bar [[buffer(0)]] , constant _mslBufferSizes& _buffer_sizes [[buffer(24)]] ) { - float foo1 = 0.0; - type11 c; - float baz = foo1; - foo1 = 1.0; + float foo_1 = 0.0; + type_11 c; + float baz = foo_1; + foo_1 = 1.0; metal::float4x4 matrix = bar.matrix; - type3 arr = bar.arr; + type_3 arr = bar.arr; float b = bar.matrix[3].x; int a = bar.data[(1 + (_buffer_sizes.size0 - 88 - 4) / 8) - 2u]; - float _e25 = read_from_private(foo1); + float _e25 = read_from_private(foo_1); bar.matrix[1].z = 1.0; bar.matrix = metal::float4x4(metal::float4(0.0), metal::float4(1.0), metal::float4(2.0), metal::float4(3.0)); - for(int _i=0; _i<2; ++_i) bar.arr.inner[_i] = type3 {metal::uint2(0u), metal::uint2(1u)}.inner[_i]; + for(int _i=0; _i<2; ++_i) bar.arr.inner[_i] = type_3 {metal::uint2(0u), metal::uint2(1u)}.inner[_i]; bar.data[1] = 1; - for(int _i=0; _i<5; ++_i) c.inner[_i] = type11 {a, static_cast(b), 3, 4, 5}.inner[_i]; + for(int _i=0; _i<5; ++_i) c.inner[_i] = type_11 {a, static_cast(b), 3, 4, 5}.inner[_i]; c.inner[vi + 1u] = 42; int value = c.inner[vi]; return fooOutput { matrix * static_cast(metal::int4(value)) }; @@ -63,7 +63,7 @@ kernel void atomics( , constant _mslBufferSizes& _buffer_sizes [[buffer(24)]] ) { int tmp; - int value1 = metal::atomic_load_explicit(&bar.atom, metal::memory_order_relaxed); + int value_1 = metal::atomic_load_explicit(&bar.atom, metal::memory_order_relaxed); int _e6 = metal::atomic_fetch_add_explicit(&bar.atom, 5, metal::memory_order_relaxed); tmp = _e6; int _e9 = metal::atomic_fetch_sub_explicit(&bar.atom, 5, metal::memory_order_relaxed); @@ -80,6 +80,6 @@ kernel void atomics( tmp = _e24; int _e27 = metal::atomic_exchange_explicit(&bar.atom, 5, metal::memory_order_relaxed); tmp = _e27; - metal::atomic_store_explicit(&bar.atom, value1, metal::memory_order_relaxed); + metal::atomic_store_explicit(&bar.atom, value_1, metal::memory_order_relaxed); return; } diff --git a/tests/out/msl/bits.msl b/tests/out/msl/bits.msl index 70ca905e39..3067ab4165 100644 --- a/tests/out/msl/bits.msl +++ b/tests/out/msl/bits.msl @@ -3,7 +3,7 @@ #include -kernel void main1( +kernel void main_( ) { int i = 0; metal::int2 i2_; diff --git a/tests/out/msl/boids.msl b/tests/out/msl/boids.msl index 0d3809c91b..461602f882 100644 --- a/tests/out/msl/boids.msl +++ b/tests/out/msl/boids.msl @@ -21,14 +21,14 @@ struct SimParams { float rule2Scale; float rule3Scale; }; -typedef Particle type3[1]; +typedef Particle type_3[1]; struct Particles { - type3 particles; + type_3 particles; }; -struct main1Input { +struct main_Input { }; -kernel void main1( +kernel void main_( metal::uint3 global_invocation_id [[thread_position_in_grid]] , constant SimParams& params [[buffer(0)]] , constant Particles& particlesSrc [[buffer(1)]] diff --git a/tests/out/msl/collatz.msl b/tests/out/msl/collatz.msl index b3053e6c53..22769a8a5e 100644 --- a/tests/out/msl/collatz.msl +++ b/tests/out/msl/collatz.msl @@ -6,9 +6,9 @@ struct _mslBufferSizes { metal::uint size0; }; -typedef metal::uint type1[1]; +typedef metal::uint type_1[1]; struct PrimeIndices { - type1 data; + type_1 data; }; metal::uint collatz_iterations( @@ -37,9 +37,9 @@ metal::uint collatz_iterations( return _e24; } -struct main1Input { +struct main_Input { }; -kernel void main1( +kernel void main_( metal::uint3 global_id [[thread_position_in_grid]] , device PrimeIndices& v_indices [[user(fake0)]] ) { diff --git a/tests/out/msl/control-flow.msl b/tests/out/msl/control-flow.msl index 8662b8b30a..e2ba6730e7 100644 --- a/tests/out/msl/control-flow.msl +++ b/tests/out/msl/control-flow.msl @@ -42,9 +42,9 @@ void loop_switch_continue( return; } -struct main1Input { +struct main_Input { }; -kernel void main1( +kernel void main_( metal::uint3 global_id [[thread_position_in_grid]] ) { int pos; diff --git a/tests/out/msl/empty-global-name.msl b/tests/out/msl/empty-global-name.msl new file mode 100644 index 0000000000..efae101f40 --- /dev/null +++ b/tests/out/msl/empty-global-name.msl @@ -0,0 +1,21 @@ +// language: metal1.1 +#include +#include + +struct type_1 { + int member; +}; + +void function( + device type_1& unnamed +) { + int _e8 = unnamed.member; + unnamed.member = _e8 + 1; + return; +} + +kernel void main_( + device type_1& unnamed [[user(fake0)]] +) { + function(unnamed); +} diff --git a/tests/out/msl/empty.msl b/tests/out/msl/empty.msl index b918cf431e..ddc6b6bf1f 100644 --- a/tests/out/msl/empty.msl +++ b/tests/out/msl/empty.msl @@ -3,7 +3,7 @@ #include -kernel void main1( +kernel void main_( ) { return; } diff --git a/tests/out/msl/extra.msl b/tests/out/msl/extra.msl index a2613a6e04..e13f0c2ac6 100644 --- a/tests/out/msl/extra.msl +++ b/tests/out/msl/extra.msl @@ -5,27 +5,27 @@ struct PushConstants { metal::uint index; char _pad1[12]; - metal::float2 double1; + metal::float2 double_; }; struct FragmentIn { metal::float4 color; metal::uint primitive_index; }; -struct main1Input { +struct main_Input { metal::float4 color [[user(loc0), center_perspective]]; }; -struct main1Output { +struct main_Output { metal::float4 member [[color(0)]]; }; -fragment main1Output main1( - main1Input varyings [[stage_in]] +fragment main_Output main_( + main_Input varyings [[stage_in]] , metal::uint primitive_index [[primitive_id]] ) { const FragmentIn in = { varyings.color, primitive_index }; if ((in.primitive_index % 2u) == 0u) { - return main1Output { in.color }; + return main_Output { in.color }; } else { - return main1Output { metal::float4(metal::float3(1.0) - in.color.xyz, in.color.w) }; + return main_Output { metal::float4(metal::float3(1.0) - in.color.xyz, in.color.w) }; } } diff --git a/tests/out/msl/globals.msl b/tests/out/msl/globals.msl index 28e7321943..a7693a0ebc 100644 --- a/tests/out/msl/globals.msl +++ b/tests/out/msl/globals.msl @@ -3,12 +3,12 @@ #include constexpr constant bool Foo = true; -struct type2 { +struct type_2 { float inner[10u]; }; -kernel void main1( - threadgroup type2& wg +kernel void main_( + threadgroup type_2& wg , threadgroup metal::atomic_uint& at ) { wg.inner[3] = 1.0; diff --git a/tests/out/msl/image.msl b/tests/out/msl/image.msl index 1c8e5e4ea8..449dc9c433 100644 --- a/tests/out/msl/image.msl +++ b/tests/out/msl/image.msl @@ -2,11 +2,11 @@ #include #include -constant metal::int2 const_type8_ = {3, 1}; +constant metal::int2 const_type_8_ = {3, 1}; -struct main1Input { +struct main_Input { }; -kernel void main1( +kernel void main_( metal::uint3 local_id [[thread_position_in_threadgroup]] , metal::texture2d image_mipmapped_src [[user(fake0)]] , metal::texture2d_ms image_multisampled_src [[user(fake0)]] @@ -28,21 +28,21 @@ kernel void main1( struct depth_loadInput { }; kernel void depth_load( - metal::uint3 local_id1 [[thread_position_in_threadgroup]] + metal::uint3 local_id_1 [[thread_position_in_threadgroup]] , metal::depth2d_ms image_depth_multisampled_src [[user(fake0)]] , metal::texture2d image_storage_src [[user(fake0)]] , metal::texture1d image_dst [[user(fake0)]] ) { - metal::int2 dim1 = int2(image_storage_src.get_width(), image_storage_src.get_height()); - metal::int2 itc1 = (dim1 * static_cast(local_id1.xy)) % metal::int2(10, 20); - float val = image_depth_multisampled_src.read(metal::uint2(itc1), static_cast(local_id1.z)); - image_dst.write(metal::uint4(static_cast(val)), metal::uint(itc1.x)); + metal::int2 dim_1 = int2(image_storage_src.get_width(), image_storage_src.get_height()); + metal::int2 itc_1 = (dim_1 * static_cast(local_id_1.xy)) % metal::int2(10, 20); + float val = image_depth_multisampled_src.read(metal::uint2(itc_1), static_cast(local_id_1.z)); + image_dst.write(metal::uint4(static_cast(val)), metal::uint(itc_1.x)); return; } struct queriesOutput { - metal::float4 member2 [[position]]; + metal::float4 member_2 [[position]]; }; vertex queriesOutput queries( metal::texture1d image_1d [[user(fake0)]] @@ -69,7 +69,7 @@ vertex queriesOutput queries( struct levels_queriesOutput { - metal::float4 member3 [[position]]; + metal::float4 member_3 [[position]]; }; vertex levels_queriesOutput levels_queries( metal::texture2d image_2d [[user(fake0)]] @@ -87,13 +87,13 @@ vertex levels_queriesOutput levels_queries( int num_layers_cube = int(image_cube_array.get_array_size()); int num_levels_3d = int(image_3d.get_num_mip_levels()); int num_samples_aa = int(image_aa.get_num_samples()); - int sum1 = ((((((num_layers_2d + num_layers_cube) + num_samples_aa) + num_levels_2d) + num_levels_2d_array) + num_levels_3d) + num_levels_cube) + num_levels_cube_array; - return levels_queriesOutput { metal::float4(static_cast(sum1)) }; + int sum_1 = ((((((num_layers_2d + num_layers_cube) + num_samples_aa) + num_levels_2d) + num_levels_2d_array) + num_levels_3d) + num_levels_cube) + num_levels_cube_array; + return levels_queriesOutput { metal::float4(static_cast(sum_1)) }; } struct sampleOutput { - metal::float4 member4 [[color(0)]]; + metal::float4 member_4 [[color(0)]]; }; fragment sampleOutput sample( metal::texture1d image_1d [[user(fake0)]] @@ -103,22 +103,22 @@ fragment sampleOutput sample( metal::float2 tc = metal::float2(0.5); metal::float4 s1d = image_1d.sample(sampler_reg, tc.x); metal::float4 s2d = image_2d.sample(sampler_reg, tc); - metal::float4 s2d_offset = image_2d.sample(sampler_reg, tc, const_type8_); + metal::float4 s2d_offset = image_2d.sample(sampler_reg, tc, const_type_8_); metal::float4 s2d_level = image_2d.sample(sampler_reg, tc, metal::level(2.299999952316284)); - metal::float4 s2d_level_offset = image_2d.sample(sampler_reg, tc, metal::level(2.299999952316284), const_type8_); + metal::float4 s2d_level_offset = image_2d.sample(sampler_reg, tc, metal::level(2.299999952316284), const_type_8_); return sampleOutput { (((s1d + s2d) + s2d_offset) + s2d_level) + s2d_level_offset }; } struct sample_comparisonOutput { - float member5 [[color(0)]]; + float member_5 [[color(0)]]; }; fragment sample_comparisonOutput sample_comparison( metal::sampler sampler_cmp [[user(fake0)]] , metal::depth2d image_2d_depth [[user(fake0)]] ) { - metal::float2 tc1 = metal::float2(0.5); - float s2d_depth = image_2d_depth.sample_compare(sampler_cmp, tc1, 0.5); - float s2d_depth_level = image_2d_depth.sample_compare(sampler_cmp, tc1, 0.5); + metal::float2 tc_1 = metal::float2(0.5); + float s2d_depth = image_2d_depth.sample_compare(sampler_cmp, tc_1, 0.5); + float s2d_depth_level = image_2d_depth.sample_compare(sampler_cmp, tc_1, 0.5); return sample_comparisonOutput { s2d_depth + s2d_depth_level }; } diff --git a/tests/out/msl/interface.msl b/tests/out/msl/interface.msl index abe791a276..9dca449a69 100644 --- a/tests/out/msl/interface.msl +++ b/tests/out/msl/interface.msl @@ -11,61 +11,61 @@ struct FragmentOutput { metal::uint sample_mask; float color; }; -struct type4 { +struct type_4 { metal::uint inner[1]; }; -struct vertex1Input { +struct vertex_Input { metal::uint color [[attribute(10)]]; }; -struct vertex1Output { +struct vertex_Output { metal::float4 position [[position]]; float varying [[user(loc1), center_perspective]]; }; -vertex vertex1Output vertex1( - vertex1Input varyings [[stage_in]] +vertex vertex_Output vertex_( + vertex_Input varyings [[stage_in]] , metal::uint vertex_index [[vertex_id]] , metal::uint instance_index [[instance_id]] ) { const auto color = varyings.color; metal::uint tmp = (vertex_index + instance_index) + color; const auto _tmp = VertexOutput {metal::float4(1.0), static_cast(tmp)}; - return vertex1Output { _tmp.position, _tmp.varying }; + return vertex_Output { _tmp.position, _tmp.varying }; } -struct fragment1Input { +struct fragment_Input { float varying [[user(loc1), center_perspective]]; }; -struct fragment1Output { +struct fragment_Output { float depth [[depth(any)]]; metal::uint sample_mask [[sample_mask]]; float color [[color(0)]]; }; -fragment fragment1Output fragment1( - fragment1Input varyings1 [[stage_in]] +fragment fragment_Output fragment_( + fragment_Input varyings_1 [[stage_in]] , metal::float4 position [[position]] , bool front_facing [[front_facing]] , metal::uint sample_index [[sample_id]] , metal::uint sample_mask [[sample_mask]] ) { - const VertexOutput in = { position, varyings1.varying }; + const VertexOutput in = { position, varyings_1.varying }; metal::uint mask = sample_mask & (1u << sample_index); - float color1 = front_facing ? 1.0 : 0.0; - const auto _tmp = FragmentOutput {in.varying, mask, color1}; - return fragment1Output { _tmp.depth, _tmp.sample_mask, _tmp.color }; + float color_1 = front_facing ? 1.0 : 0.0; + const auto _tmp = FragmentOutput {in.varying, mask, color_1}; + return fragment_Output { _tmp.depth, _tmp.sample_mask, _tmp.color }; } -struct compute1Input { +struct compute_Input { }; -kernel void compute1( +kernel void compute_( metal::uint3 global_id [[thread_position_in_grid]] , metal::uint3 local_id [[thread_position_in_threadgroup]] , metal::uint local_index [[thread_index_in_threadgroup]] , metal::uint3 wg_id [[threadgroup_position_in_grid]] , metal::uint3 num_wgs [[threadgroups_per_grid]] -, threadgroup type4& output +, threadgroup type_4& output ) { output.inner[0] = (((global_id.x + local_id.x) + local_index) + wg_id.x) + num_wgs.x; return; diff --git a/tests/out/msl/interpolate.msl b/tests/out/msl/interpolate.msl index f2600ba132..24a259806a 100644 --- a/tests/out/msl/interpolate.msl +++ b/tests/out/msl/interpolate.msl @@ -13,7 +13,7 @@ struct FragmentInput { float perspective_sample; }; -struct main1Output { +struct main_Output { metal::float4 position [[position]]; metal::uint flat [[user(loc0), flat]]; float linear [[user(loc1), center_no_perspective]]; @@ -23,7 +23,7 @@ struct main1Output { float perspective_centroid [[user(loc5), centroid_perspective]]; float perspective_sample [[user(loc6), sample_perspective]]; }; -vertex main1Output main1( +vertex main_Output main_( ) { FragmentInput out; out.position = metal::float4(2.0, 4.0, 5.0, 6.0); @@ -36,11 +36,11 @@ vertex main1Output main1( out.perspective_sample = 2744.0; FragmentInput _e30 = out; const auto _tmp = _e30; - return main1Output { _tmp.position, _tmp.flat, _tmp.linear, _tmp.linear_centroid, _tmp.linear_sample, _tmp.perspective, _tmp.perspective_centroid, _tmp.perspective_sample }; + return main_Output { _tmp.position, _tmp.flat, _tmp.linear, _tmp.linear_centroid, _tmp.linear_sample, _tmp.perspective, _tmp.perspective_centroid, _tmp.perspective_sample }; } -struct main2Input { +struct main_1Input { metal::uint flat [[user(loc0), flat]]; float linear [[user(loc1), center_no_perspective]]; metal::float2 linear_centroid [[user(loc2), centroid_no_perspective]]; @@ -49,10 +49,10 @@ struct main2Input { float perspective_centroid [[user(loc5), centroid_perspective]]; float perspective_sample [[user(loc6), sample_perspective]]; }; -fragment void main2( - main2Input varyings1 [[stage_in]] +fragment void main_1( + main_1Input varyings_1 [[stage_in]] , metal::float4 position [[position]] ) { - const FragmentInput val = { position, varyings1.flat, varyings1.linear, varyings1.linear_centroid, varyings1.linear_sample, varyings1.perspective, varyings1.perspective_centroid, varyings1.perspective_sample }; + const FragmentInput val = { position, varyings_1.flat, varyings_1.linear, varyings_1.linear_centroid, varyings_1.linear_sample, varyings_1.perspective, varyings_1.perspective_centroid, varyings_1.perspective_sample }; return; } diff --git a/tests/out/msl/operators.msl b/tests/out/msl/operators.msl index c1e52481cc..37cf121fbf 100644 --- a/tests/out/msl/operators.msl +++ b/tests/out/msl/operators.msl @@ -57,13 +57,13 @@ float constructors( void modulo( ) { - int a1 = 1 % 1; - float b1 = metal::fmod(1.0, 1.0); + int a_1 = 1 % 1; + float b_1 = metal::fmod(1.0, 1.0); metal::int3 c = metal::int3(1) % metal::int3(1); metal::float3 d = metal::fmod(metal::float3(1.0), metal::float3(1.0)); } -kernel void main1( +kernel void main_( ) { metal::float4 _e4 = builtins(); metal::float4 _e5 = splat(); diff --git a/tests/out/msl/quad-vert.msl b/tests/out/msl/quad-vert.msl index be0ae6c00d..de1bfb598e 100644 --- a/tests/out/msl/quad-vert.msl +++ b/tests/out/msl/quad-vert.msl @@ -2,58 +2,58 @@ #include #include -struct type5 { +struct type_5 { float inner[1u]; }; struct gl_PerVertex { metal::float4 gl_Position; float gl_PointSize; - type5 gl_ClipDistance; - type5 gl_CullDistance; + type_5 gl_ClipDistance; + type_5 gl_CullDistance; }; -struct type9 { +struct type_9 { metal::float2 member; metal::float4 gl_Position; }; -constant metal::float4 const_type3_ = {0.0, 0.0, 0.0, 1.0}; -constant type5 const_type5_ = {0.0}; -constant gl_PerVertex const_gl_PerVertex = {const_type3_, 1.0, const_type5_, const_type5_}; +constant metal::float4 const_type_3_ = {0.0, 0.0, 0.0, 1.0}; +constant type_5 const_type_5_ = {0.0}; +constant gl_PerVertex const_gl_PerVertex = {const_type_3_, 1.0, const_type_5_, const_type_5_}; -void main2( +void main_1( thread metal::float2& v_uv, - thread metal::float2 const& a_uv1, + thread metal::float2 const& a_uv_1, thread gl_PerVertex& perVertexStruct, - thread metal::float2 const& a_pos1 + thread metal::float2 const& a_pos_1 ) { - metal::float2 _e12 = a_uv1; + metal::float2 _e12 = a_uv_1; v_uv = _e12; - metal::float2 _e13 = a_pos1; + metal::float2 _e13 = a_pos_1; perVertexStruct.gl_Position = metal::float4(_e13.x, _e13.y, 0.0, 1.0); return; } -struct main1Input { +struct main_Input { metal::float2 a_uv [[attribute(1)]]; metal::float2 a_pos [[attribute(0)]]; }; -struct main1Output { +struct main_Output { metal::float2 member [[user(loc0), center_perspective]]; metal::float4 gl_Position [[position]]; }; -vertex main1Output main1( - main1Input varyings [[stage_in]] +vertex main_Output main_( + main_Input varyings [[stage_in]] ) { metal::float2 v_uv = {}; - metal::float2 a_uv1 = {}; + metal::float2 a_uv_1 = {}; gl_PerVertex perVertexStruct = const_gl_PerVertex; - metal::float2 a_pos1 = {}; + metal::float2 a_pos_1 = {}; const auto a_uv = varyings.a_uv; const auto a_pos = varyings.a_pos; - a_uv1 = a_uv; - a_pos1 = a_pos; - main2(v_uv, a_uv1, perVertexStruct, a_pos1); + a_uv_1 = a_uv; + a_pos_1 = a_pos; + main_1(v_uv, a_uv_1, perVertexStruct, a_pos_1); metal::float2 _e7 = v_uv; metal::float4 _e8 = perVertexStruct.gl_Position; - const auto _tmp = type9 {_e7, _e8}; - return main1Output { _tmp.member, _tmp.gl_Position }; + const auto _tmp = type_9 {_e7, _e8}; + return main_Output { _tmp.member, _tmp.gl_Position }; } diff --git a/tests/out/msl/quad.msl b/tests/out/msl/quad.msl index bb7e971bef..b55036702b 100644 --- a/tests/out/msl/quad.msl +++ b/tests/out/msl/quad.msl @@ -8,47 +8,47 @@ struct VertexOutput { metal::float4 position; }; -struct main1Input { +struct main_Input { metal::float2 pos [[attribute(0)]]; metal::float2 uv [[attribute(1)]]; }; -struct main1Output { +struct main_Output { metal::float2 uv [[user(loc0), center_perspective]]; metal::float4 position [[position]]; }; -vertex main1Output main1( - main1Input varyings [[stage_in]] +vertex main_Output main_( + main_Input varyings [[stage_in]] ) { const auto pos = varyings.pos; const auto uv = varyings.uv; const auto _tmp = VertexOutput {uv, metal::float4(c_scale * pos, 0.0, 1.0)}; - return main1Output { _tmp.uv, _tmp.position }; + return main_Output { _tmp.uv, _tmp.position }; } -struct main2Input { - metal::float2 uv1 [[user(loc0), center_perspective]]; +struct main_1Input { + metal::float2 uv_1 [[user(loc0), center_perspective]]; }; -struct main2Output { - metal::float4 member1 [[color(0)]]; +struct main_1Output { + metal::float4 member_1 [[color(0)]]; }; -fragment main2Output main2( - main2Input varyings1 [[stage_in]] +fragment main_1Output main_1( + main_1Input varyings_1 [[stage_in]] , metal::texture2d u_texture [[user(fake0)]] , metal::sampler u_sampler [[user(fake0)]] ) { - const auto uv1 = varyings1.uv1; - metal::float4 color = u_texture.sample(u_sampler, uv1); + const auto uv_1 = varyings_1.uv_1; + metal::float4 color = u_texture.sample(u_sampler, uv_1); if (color.w == 0.0) { metal::discard_fragment(); } metal::float4 premultiplied = color.w * color; - return main2Output { premultiplied }; + return main_1Output { premultiplied }; } struct fs_extraOutput { - metal::float4 member2 [[color(0)]]; + metal::float4 member_2 [[color(0)]]; }; fragment fs_extraOutput fs_extra( ) { diff --git a/tests/out/msl/shadow.msl b/tests/out/msl/shadow.msl index 7b11464471..33475b841a 100644 --- a/tests/out/msl/shadow.msl +++ b/tests/out/msl/shadow.msl @@ -15,9 +15,9 @@ struct Light { metal::float4 pos; metal::float4 color; }; -typedef Light type3[1]; +typedef Light type_3[1]; struct Lights { - type3 data; + type_3 data; }; constant metal::float3 c_ambient = {0.05000000074505806, 0.05000000074505806, 0.05000000074505806}; diff --git a/tests/out/msl/skybox.msl b/tests/out/msl/skybox.msl index 1a479a89ea..ec7942cb4b 100644 --- a/tests/out/msl/skybox.msl +++ b/tests/out/msl/skybox.msl @@ -43,10 +43,10 @@ struct fs_mainInput { metal::float3 uv [[user(loc0), center_perspective]]; }; struct fs_mainOutput { - metal::float4 member1 [[color(0)]]; + metal::float4 member_1 [[color(0)]]; }; fragment fs_mainOutput fs_main( - fs_mainInput varyings1 [[stage_in]] + fs_mainInput varyings_1 [[stage_in]] , metal::float4 position [[position]] , metal::texturecube r_texture [[texture(0)]] ) { @@ -58,7 +58,7 @@ fragment fs_mainOutput fs_main( metal::min_filter::linear, metal::coord::normalized ); - const VertexOutput in = { position, varyings1.uv }; + const VertexOutput in = { position, varyings_1.uv }; metal::float4 _e5 = r_texture.sample(r_sampler, in.uv); return fs_mainOutput { _e5 }; } diff --git a/tests/out/msl/texture-arg.msl b/tests/out/msl/texture-arg.msl index 39919e06d1..49533df9ef 100644 --- a/tests/out/msl/texture-arg.msl +++ b/tests/out/msl/texture-arg.msl @@ -11,13 +11,13 @@ metal::float4 test( return _e7; } -struct main1Output { +struct main_Output { metal::float4 member [[color(0)]]; }; -fragment main1Output main1( +fragment main_Output main_( metal::texture2d Texture [[user(fake0)]] , metal::sampler Sampler [[user(fake0)]] ) { metal::float4 _e2 = test(Texture, Sampler); - return main1Output { _e2 }; + return main_Output { _e2 }; } diff --git a/tests/out/wgsl/210-bevy-2d-shader-frag.wgsl b/tests/out/wgsl/210-bevy-2d-shader-frag.wgsl index 30cd002911..c4e736b461 100644 --- a/tests/out/wgsl/210-bevy-2d-shader-frag.wgsl +++ b/tests/out/wgsl/210-bevy-2d-shader-frag.wgsl @@ -7,12 +7,12 @@ struct FragmentOutput { [[location(0)]] o_Target: vec4; }; -var v_Uv1: vec2; +var v_Uv_1: vec2; var o_Target: vec4; [[group(1), binding(0)]] var global: ColorMaterial_color; -fn main1() { +fn main_1() { var color: vec4; let e4: vec4 = global.Color; @@ -24,8 +24,8 @@ fn main1() { [[stage(fragment)]] fn main([[location(0)]] v_Uv: vec2) -> FragmentOutput { - v_Uv1 = v_Uv; - main1(); + v_Uv_1 = v_Uv; + main_1(); let e9: vec4 = o_Target; return FragmentOutput(e9); } diff --git a/tests/out/wgsl/210-bevy-2d-shader-vert.wgsl b/tests/out/wgsl/210-bevy-2d-shader-vert.wgsl index 0d0de959ae..122ed98538 100644 --- a/tests/out/wgsl/210-bevy-2d-shader-vert.wgsl +++ b/tests/out/wgsl/210-bevy-2d-shader-vert.wgsl @@ -18,28 +18,28 @@ struct VertexOutput { [[builtin(position)]] member: vec4; }; -var Vertex_Position1: vec3; -var Vertex_Normal1: vec3; -var Vertex_Uv1: vec2; +var Vertex_Position_1: vec3; +var Vertex_Normal_1: vec3; +var Vertex_Uv_1: vec2; var v_Uv: vec2; [[group(0), binding(0)]] var global: Camera; [[group(2), binding(0)]] -var global1: Transform; +var global_1: Transform; [[group(2), binding(1)]] -var global2: Sprite_size; +var global_2: Sprite_size; var gl_Position: vec4; -fn main1() { +fn main_1() { var position: vec3; - let e10: vec2 = Vertex_Uv1; + let e10: vec2 = Vertex_Uv_1; v_Uv = e10; - let e11: vec3 = Vertex_Position1; - let e12: vec2 = global2.size; + let e11: vec3 = Vertex_Position_1; + let e12: vec2 = global_2.size; position = (e11 * vec3(e12, 1.0)); let e18: mat4x4 = global.ViewProj; - let e19: mat4x4 = global1.Model; + let e19: mat4x4 = global_1.Model; let e21: vec3 = position; gl_Position = ((e18 * e19) * vec4(e21, 1.0)); return; @@ -47,10 +47,10 @@ fn main1() { [[stage(vertex)]] fn main([[location(0)]] Vertex_Position: vec3, [[location(1)]] Vertex_Normal: vec3, [[location(2)]] Vertex_Uv: vec2) -> VertexOutput { - Vertex_Position1 = Vertex_Position; - Vertex_Normal1 = Vertex_Normal; - Vertex_Uv1 = Vertex_Uv; - main1(); + Vertex_Position_1 = Vertex_Position; + Vertex_Normal_1 = Vertex_Normal; + Vertex_Uv_1 = Vertex_Uv; + main_1(); let e21: vec2 = v_Uv; let e23: vec4 = gl_Position; return VertexOutput(e21, e23); diff --git a/tests/out/wgsl/210-bevy-shader-vert.wgsl b/tests/out/wgsl/210-bevy-shader-vert.wgsl index 83495e2ae8..29af6ada8c 100644 --- a/tests/out/wgsl/210-bevy-shader-vert.wgsl +++ b/tests/out/wgsl/210-bevy-shader-vert.wgsl @@ -15,29 +15,29 @@ struct VertexOutput { [[builtin(position)]] member: vec4; }; -var Vertex_Position1: vec3; -var Vertex_Normal1: vec3; -var Vertex_Uv1: vec2; +var Vertex_Position_1: vec3; +var Vertex_Normal_1: vec3; +var Vertex_Uv_1: vec2; var v_Position: vec3; var v_Normal: vec3; var v_Uv: vec2; [[group(0), binding(0)]] var global: Camera; [[group(2), binding(0)]] -var global1: Transform; +var global_1: Transform; var gl_Position: vec4; -fn main1() { - let e10: mat4x4 = global1.Model; - let e11: vec3 = Vertex_Normal1; +fn main_1() { + let e10: mat4x4 = global_1.Model; + let e11: vec3 = Vertex_Normal_1; v_Normal = (e10 * vec4(e11, 1.0)).xyz; - let e16: mat4x4 = global1.Model; - let e24: vec3 = Vertex_Normal1; + let e16: mat4x4 = global_1.Model; + let e24: vec3 = Vertex_Normal_1; v_Normal = (mat3x3(e16[0].xyz, e16[1].xyz, e16[2].xyz) * e24); - let e26: mat4x4 = global1.Model; - let e27: vec3 = Vertex_Position1; + let e26: mat4x4 = global_1.Model; + let e27: vec3 = Vertex_Position_1; v_Position = (e26 * vec4(e27, 1.0)).xyz; - let e32: vec2 = Vertex_Uv1; + let e32: vec2 = Vertex_Uv_1; v_Uv = e32; let e34: mat4x4 = global.ViewProj; let e35: vec3 = v_Position; @@ -47,10 +47,10 @@ fn main1() { [[stage(vertex)]] fn main([[location(0)]] Vertex_Position: vec3, [[location(1)]] Vertex_Normal: vec3, [[location(2)]] Vertex_Uv: vec2) -> VertexOutput { - Vertex_Position1 = Vertex_Position; - Vertex_Normal1 = Vertex_Normal; - Vertex_Uv1 = Vertex_Uv; - main1(); + Vertex_Position_1 = Vertex_Position; + Vertex_Normal_1 = Vertex_Normal; + Vertex_Uv_1 = Vertex_Uv; + main_1(); let e23: vec3 = v_Position; let e25: vec3 = v_Normal; let e27: vec2 = v_Uv; diff --git a/tests/out/wgsl/246-collatz-comp.wgsl b/tests/out/wgsl/246-collatz-comp.wgsl index 993ec7ff85..4451a7908e 100644 --- a/tests/out/wgsl/246-collatz-comp.wgsl +++ b/tests/out/wgsl/246-collatz-comp.wgsl @@ -8,26 +8,26 @@ var global: PrimeIndices; var gl_GlobalInvocationID: vec3; fn collatz_iterations(n: u32) -> u32 { - var n1: u32; + var n_1: u32; var i: u32 = 0u; - n1 = n; + n_1 = n; loop { - let e7: u32 = n1; + let e7: u32 = n_1; if (!((e7 != u32(1)))) { break; } { - let e14: u32 = n1; + let e14: u32 = n_1; if (((f32(e14) % f32(2)) == f32(0))) { { - let e22: u32 = n1; - n1 = (e22 / u32(2)); + let e22: u32 = n_1; + n_1 = (e22 / u32(2)); } } else { { - let e27: u32 = n1; - n1 = ((u32(3) * e27) + u32(1)); + let e27: u32 = n_1; + n_1 = ((u32(3) * e27) + u32(1)); } } let e33: u32 = i; @@ -38,7 +38,7 @@ fn collatz_iterations(n: u32) -> u32 { return e36; } -fn main1() { +fn main_1() { var index: u32; let e3: vec3 = gl_GlobalInvocationID; @@ -55,6 +55,6 @@ fn main1() { [[stage(compute), workgroup_size(1, 1, 1)]] fn main([[builtin(global_invocation_id)]] param: vec3) { gl_GlobalInvocationID = param; - main1(); + main_1(); return; } diff --git a/tests/out/wgsl/277-casting-vert.wgsl b/tests/out/wgsl/277-casting-vert.wgsl index 673f8443da..f05db0372d 100644 --- a/tests/out/wgsl/277-casting-vert.wgsl +++ b/tests/out/wgsl/277-casting-vert.wgsl @@ -1,10 +1,10 @@ -fn main1() { +fn main_1() { var a: f32 = 1.0; } [[stage(vertex)]] fn main() { - main1(); + main_1(); return; } diff --git a/tests/out/wgsl/280-matrix-cast-vert.wgsl b/tests/out/wgsl/280-matrix-cast-vert.wgsl index d3a55eb8eb..da13932f35 100644 --- a/tests/out/wgsl/280-matrix-cast-vert.wgsl +++ b/tests/out/wgsl/280-matrix-cast-vert.wgsl @@ -1,4 +1,4 @@ -fn main1() { +fn main_1() { var a: mat4x4 = 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 e1: f32 = f32(1); @@ -6,6 +6,6 @@ fn main1() { [[stage(vertex)]] fn main() { - main1(); + main_1(); return; } diff --git a/tests/out/wgsl/484-preprocessor-if-vert.wgsl b/tests/out/wgsl/484-preprocessor-if-vert.wgsl index a5c402fad3..ebd8567c94 100644 --- a/tests/out/wgsl/484-preprocessor-if-vert.wgsl +++ b/tests/out/wgsl/484-preprocessor-if-vert.wgsl @@ -1,9 +1,9 @@ -fn main1() { +fn main_1() { return; } [[stage(vertex)]] fn main() { - main1(); + main_1(); return; } diff --git a/tests/out/wgsl/800-out-of-bounds-panic-vert.wgsl b/tests/out/wgsl/800-out-of-bounds-panic-vert.wgsl index 10ae39b3b5..bbd10113cb 100644 --- a/tests/out/wgsl/800-out-of-bounds-panic-vert.wgsl +++ b/tests/out/wgsl/800-out-of-bounds-panic-vert.wgsl @@ -15,18 +15,18 @@ struct VertexOutput { [[group(0), binding(0)]] var global: Globals; -var global1: VertexPushConstants; -var position1: vec2; -var color1: vec4; +var global_1: VertexPushConstants; +var position_1: vec2; +var color_1: vec4; var frag_color: vec4; var gl_Position: vec4; -fn main1() { - let e7: vec4 = color1; +fn main_1() { + let e7: vec4 = color_1; frag_color = e7; let e9: mat4x4 = global.view_matrix; - let e10: mat4x4 = global1.world_matrix; - let e12: vec2 = position1; + let e10: mat4x4 = global_1.world_matrix; + let e12: vec2 = position_1; gl_Position = ((e9 * e10) * vec4(e12, 0.0, 1.0)); let e18: vec4 = gl_Position; let e20: vec4 = gl_Position; @@ -36,9 +36,9 @@ fn main1() { [[stage(vertex)]] fn main([[location(0)]] position: vec2, [[location(1)]] color: vec4) -> VertexOutput { - position1 = position; - color1 = color; - main1(); + position_1 = position; + color_1 = color; + main_1(); let e15: vec4 = frag_color; let e17: vec4 = gl_Position; return VertexOutput(e15, e17); diff --git a/tests/out/wgsl/896-push-constant-vert.wgsl b/tests/out/wgsl/896-push-constant-vert.wgsl index a8f7df78fb..063f22a4f1 100644 --- a/tests/out/wgsl/896-push-constant-vert.wgsl +++ b/tests/out/wgsl/896-push-constant-vert.wgsl @@ -5,12 +5,12 @@ struct PushConstants { var c: PushConstants; -fn main1() { +fn main_1() { return; } [[stage(vertex)]] fn main() { - main1(); + main_1(); return; } diff --git a/tests/out/wgsl/900-implicit-conversions-vert.wgsl b/tests/out/wgsl/900-implicit-conversions-vert.wgsl index 4704b44192..bb86b505f9 100644 --- a/tests/out/wgsl/900-implicit-conversions-vert.wgsl +++ b/tests/out/wgsl/900-implicit-conversions-vert.wgsl @@ -1,68 +1,68 @@ fn exact(a: f32) { - var a1: f32; + var a_1: f32; - a1 = a; + a_1 = a; return; } -fn exact1(a2: i32) { - var a3: i32; +fn exact_1(a_2: i32) { + var a_3: i32; - a3 = a2; + a_3 = a_2; return; } -fn implicit(a4: f32) { - var a5: f32; +fn implicit(a_4: f32) { + var a_5: f32; - a5 = a4; + a_5 = a_4; return; } -fn implicit1(a6: i32) { - var a7: i32; +fn implicit_1(a_6: i32) { + var a_7: i32; - a7 = a6; + a_7 = a_6; return; } fn implicit_dims(v: f32) { - var v1: f32; + var v_1: f32; - v1 = v; + v_1 = v; return; } -fn implicit_dims1(v2: vec2) { - var v3: vec2; +fn implicit_dims_1(v_2: vec2) { + var v_3: vec2; - v3 = v2; + v_3 = v_2; return; } -fn implicit_dims2(v4: vec3) { - var v5: vec3; +fn implicit_dims_2(v_4: vec3) { + var v_5: vec3; - v5 = v4; + v_5 = v_4; return; } -fn implicit_dims3(v6: vec4) { - var v7: vec4; +fn implicit_dims_3(v_6: vec4) { + var v_7: vec4; - v7 = v6; + v_7 = v_6; return; } -fn main1() { - exact1(1); +fn main_1() { + exact_1(1); implicit(f32(1u)); - implicit_dims2(vec3(vec3(1))); + implicit_dims_2(vec3(vec3(1))); return; } [[stage(vertex)]] fn main() { - main1(); + main_1(); return; } diff --git a/tests/out/wgsl/901-lhs-field-select-vert.wgsl b/tests/out/wgsl/901-lhs-field-select-vert.wgsl index aa791b9177..13695097b9 100644 --- a/tests/out/wgsl/901-lhs-field-select-vert.wgsl +++ b/tests/out/wgsl/901-lhs-field-select-vert.wgsl @@ -1,4 +1,4 @@ -fn main1() { +fn main_1() { var a: vec4 = vec4(1.0, 1.0, 1.0, 1.0); a.x = 2.0; @@ -7,6 +7,6 @@ fn main1() { [[stage(vertex)]] fn main() { - main1(); + main_1(); return; } diff --git a/tests/out/wgsl/931-constant-emitting-vert.wgsl b/tests/out/wgsl/931-constant-emitting-vert.wgsl index 56a4015bde..0e3e656a7f 100644 --- a/tests/out/wgsl/931-constant-emitting-vert.wgsl +++ b/tests/out/wgsl/931-constant-emitting-vert.wgsl @@ -1,13 +1,13 @@ -fn function1() -> f32 { +fn function_() -> f32 { return 0.0; } -fn main1() { +fn main_1() { return; } [[stage(vertex)]] fn main() { - main1(); + main_1(); return; } diff --git a/tests/out/wgsl/932-for-loop-if-vert.wgsl b/tests/out/wgsl/932-for-loop-if-vert.wgsl index a66020fd8d..9af904e9a3 100644 --- a/tests/out/wgsl/932-for-loop-if-vert.wgsl +++ b/tests/out/wgsl/932-for-loop-if-vert.wgsl @@ -1,4 +1,4 @@ -fn main1() { +fn main_1() { var i: i32 = 0; loop { @@ -18,6 +18,6 @@ fn main1() { [[stage(vertex)]] fn main() { - main1(); + main_1(); return; } diff --git a/tests/out/wgsl/access.wgsl b/tests/out/wgsl/access.wgsl index 9b4c7b0e70..ad1666f9a6 100644 --- a/tests/out/wgsl/access.wgsl +++ b/tests/out/wgsl/access.wgsl @@ -9,24 +9,24 @@ struct Bar { [[group(0), binding(0)]] var bar: Bar; -fn read_from_private(foo2: ptr) -> f32 { - let e2: f32 = (*foo2); +fn read_from_private(foo_2: ptr) -> f32 { + let e2: f32 = (*foo_2); return e2; } [[stage(vertex)]] fn foo([[builtin(vertex_index)]] vi: u32) -> [[builtin(position)]] vec4 { - var foo1: f32 = 0.0; + var foo_1: f32 = 0.0; var c: array; - let baz: f32 = foo1; - foo1 = 1.0; + let baz: f32 = foo_1; + foo_1 = 1.0; let matrix: mat4x4 = bar.matrix; let arr: array,2> = bar.arr; let b: f32 = bar.matrix[3][0]; let a: i32 = bar.data[(arrayLength((&bar.data)) - 2u)]; - let pointer1: ptr = (&bar.data[0]); - let e25: f32 = read_from_private((&foo1)); + let pointer_: ptr = (&bar.data[0]); + let e25: f32 = read_from_private((&foo_1)); bar.matrix[1][2] = 1.0; bar.matrix = mat4x4(vec4(0.0), vec4(1.0), vec4(2.0), vec4(3.0)); bar.arr = array,2>(vec2(0u), vec2(1u)); @@ -41,7 +41,7 @@ fn foo([[builtin(vertex_index)]] vi: u32) -> [[builtin(position)]] vec4 { fn atomics() { var tmp: i32; - let value1: i32 = atomicLoad((&bar.atom)); + let value_1: i32 = atomicLoad((&bar.atom)); let e6: i32 = atomicAdd((&bar.atom), 5); tmp = e6; let e9: i32 = atomicSub((&bar.atom), 5); @@ -58,6 +58,6 @@ fn atomics() { tmp = e24; let e27: i32 = atomicExchange((&bar.atom), 5); tmp = e27; - atomicStore((&bar.atom), value1); + atomicStore((&bar.atom), value_1); return; } diff --git a/tests/out/wgsl/bevy-pbr-frag.wgsl b/tests/out/wgsl/bevy-pbr-frag.wgsl index b2c97f693a..4257361ad6 100644 --- a/tests/out/wgsl/bevy-pbr-frag.wgsl +++ b/tests/out/wgsl/bevy-pbr-frag.wgsl @@ -56,33 +56,33 @@ struct FragmentOutput { [[location(0)]] o_Target: vec4; }; -var v_WorldPosition1: vec3; -var v_WorldNormal1: vec3; -var v_Uv1: vec2; -var v_WorldTangent1: vec4; +var v_WorldPosition_1: vec3; +var v_WorldNormal_1: vec3; +var v_Uv_1: vec2; +var v_WorldTangent_1: vec4; var o_Target: vec4; [[group(0), binding(0)]] var global: CameraViewProj; [[group(0), binding(1)]] -var global1: CameraPosition; +var global_1: CameraPosition; [[group(1), binding(0)]] -var global2: Lights; +var global_2: Lights; [[group(3), binding(0)]] -var global3: StandardMaterial_base_color; +var global_3: StandardMaterial_base_color; [[group(3), binding(1)]] var StandardMaterial_base_color_texture: texture_2d; [[group(3), binding(2)]] var StandardMaterial_base_color_texture_sampler: sampler; [[group(3), binding(3)]] -var global4: StandardMaterial_roughness; +var global_4: StandardMaterial_roughness; [[group(3), binding(4)]] -var global5: StandardMaterial_metallic; +var global_5: StandardMaterial_metallic; [[group(3), binding(5)]] var StandardMaterial_metallic_roughness_texture: texture_2d; [[group(3), binding(6)]] var StandardMaterial_metallic_roughness_texture_sampler: sampler; [[group(3), binding(7)]] -var global6: StandardMaterial_reflectance; +var global_6: StandardMaterial_reflectance; [[group(3), binding(8)]] var StandardMaterial_normal_map: texture_2d; [[group(3), binding(9)]] @@ -92,7 +92,7 @@ var StandardMaterial_occlusion_texture: texture_2d; [[group(3), binding(11)]] var StandardMaterial_occlusion_texture_sampler: sampler; [[group(3), binding(12)]] -var global7: StandardMaterial_emissive; +var global_7: StandardMaterial_emissive; [[group(3), binding(13)]] var StandardMaterial_emissive_texture: texture_2d; [[group(3), binding(14)]] @@ -100,30 +100,30 @@ var StandardMaterial_emissive_texture_sampler: sampler; var gl_FrontFacing: bool; fn pow5_(x: f32) -> f32 { - var x1: f32; + var x_1: f32; var x2_: f32; - x1 = x; - let e42: f32 = x1; - let e43: f32 = x1; + x_1 = x; + let e42: f32 = x_1; + let e43: f32 = x_1; x2_ = (e42 * e43); let e46: f32 = x2_; let e47: f32 = x2_; - let e49: f32 = x1; + let e49: f32 = x_1; return ((e46 * e47) * e49); } fn getDistanceAttenuation(distanceSquare: f32, inverseRangeSquared: f32) -> f32 { - var distanceSquare1: f32; - var inverseRangeSquared1: f32; + var distanceSquare_1: f32; + var inverseRangeSquared_1: f32; var factor: f32; var smoothFactor: f32; var attenuation: f32; - distanceSquare1 = distanceSquare; - inverseRangeSquared1 = inverseRangeSquared; - let e44: f32 = distanceSquare1; - let e45: f32 = inverseRangeSquared1; + distanceSquare_1 = distanceSquare; + inverseRangeSquared_1 = inverseRangeSquared; + let e44: f32 = distanceSquare_1; + let e45: f32 = inverseRangeSquared_1; factor = (e44 * e45); let e49: f32 = factor; let e50: f32 = factor; @@ -134,27 +134,27 @@ fn getDistanceAttenuation(distanceSquare: f32, inverseRangeSquared: f32) -> f32 let e65: f32 = smoothFactor; attenuation = (e64 * e65); let e68: f32 = attenuation; - let e73: f32 = distanceSquare1; + let e73: f32 = distanceSquare_1; return ((e68 * 1.0) / max(e73, 0.00009999999747378752)); } fn D_GGX(roughness: f32, NoH: f32, h: vec3) -> f32 { - var roughness1: f32; - var NoH1: f32; + var roughness_1: f32; + var NoH_1: f32; var oneMinusNoHSquared: f32; var a: f32; var k: f32; var d: f32; - roughness1 = roughness; - NoH1 = NoH; - let e46: f32 = NoH1; - let e47: f32 = NoH1; + roughness_1 = roughness; + NoH_1 = NoH; + let e46: f32 = NoH_1; + let e47: f32 = NoH_1; oneMinusNoHSquared = (1.0 - (e46 * e47)); - let e51: f32 = NoH1; - let e52: f32 = roughness1; + let e51: f32 = NoH_1; + let e52: f32 = roughness_1; a = (e51 * e52); - let e55: f32 = roughness1; + let e55: f32 = roughness_1; let e56: f32 = oneMinusNoHSquared; let e57: f32 = a; let e58: f32 = a; @@ -166,43 +166,43 @@ fn D_GGX(roughness: f32, NoH: f32, h: vec3) -> f32 { return e70; } -fn V_SmithGGXCorrelated(roughness2: f32, NoV: f32, NoL: f32) -> f32 { - var roughness3: f32; - var NoV1: f32; - var NoL1: f32; +fn V_SmithGGXCorrelated(roughness_2: f32, NoV: f32, NoL: f32) -> f32 { + var roughness_3: f32; + var NoV_1: f32; + var NoL_1: f32; var a2_: f32; var lambdaV: f32; var lambdaL: f32; var v: f32; - roughness3 = roughness2; - NoV1 = NoV; - NoL1 = NoL; - let e46: f32 = roughness3; - let e47: f32 = roughness3; + roughness_3 = roughness_2; + NoV_1 = NoV; + NoL_1 = NoL; + let e46: f32 = roughness_3; + let e47: f32 = roughness_3; a2_ = (e46 * e47); - let e50: f32 = NoL1; - let e51: f32 = NoV1; + let e50: f32 = NoL_1; + let e51: f32 = NoV_1; let e52: f32 = a2_; - let e53: f32 = NoV1; - let e56: f32 = NoV1; + let e53: f32 = NoV_1; + let e56: f32 = NoV_1; let e58: f32 = a2_; - let e60: f32 = NoV1; + let e60: f32 = NoV_1; let e61: f32 = a2_; - let e62: f32 = NoV1; - let e65: f32 = NoV1; + let e62: f32 = NoV_1; + let e65: f32 = NoV_1; let e67: f32 = a2_; lambdaV = (e50 * sqrt((((e60 - (e61 * e62)) * e65) + e67))); - let e72: f32 = NoV1; - let e73: f32 = NoL1; + let e72: f32 = NoV_1; + let e73: f32 = NoL_1; let e74: f32 = a2_; - let e75: f32 = NoL1; - let e78: f32 = NoL1; + let e75: f32 = NoL_1; + let e78: f32 = NoL_1; let e80: f32 = a2_; - let e82: f32 = NoL1; + let e82: f32 = NoL_1; let e83: f32 = a2_; - let e84: f32 = NoL1; - let e87: f32 = NoL1; + let e84: f32 = NoL_1; + let e87: f32 = NoL_1; let e89: f32 = a2_; lambdaL = (e72 * sqrt((((e82 - (e83 * e84)) * e87) + e89))); let e95: f32 = lambdaV; @@ -214,124 +214,124 @@ fn V_SmithGGXCorrelated(roughness2: f32, NoV: f32, NoL: f32) -> f32 { fn F_Schlick(f0_: vec3, f90_: f32, VoH: f32) -> vec3 { var f90_1: f32; - var VoH1: f32; + var VoH_1: f32; f90_1 = f90_; - VoH1 = VoH; + VoH_1 = VoH; let e45: f32 = f90_1; - let e49: f32 = VoH1; - let e52: f32 = VoH1; + let e49: f32 = VoH_1; + let e52: f32 = VoH_1; let e54: f32 = pow5_((1.0 - e52)); return (f0_ + ((vec3(e45) - f0_) * e54)); } -fn F_Schlick1(f0_1: f32, f90_2: f32, VoH2: f32) -> f32 { +fn F_Schlick_1(f0_1: f32, f90_2: f32, VoH_2: f32) -> f32 { var f0_2: f32; var f90_3: f32; - var VoH3: f32; + var VoH_3: f32; f0_2 = f0_1; f90_3 = f90_2; - VoH3 = VoH2; + VoH_3 = VoH_2; let e46: f32 = f0_2; let e47: f32 = f90_3; let e48: f32 = f0_2; - let e51: f32 = VoH3; - let e54: f32 = VoH3; + let e51: f32 = VoH_3; + let e54: f32 = VoH_3; let e56: f32 = pow5_((1.0 - e54)); return (e46 + ((e47 - e48) * e56)); } fn fresnel(f0_3: vec3, LoH: f32) -> vec3 { var f0_4: vec3; - var LoH1: f32; + var LoH_1: f32; var f90_4: f32; f0_4 = f0_3; - LoH1 = LoH; + LoH_1 = LoH; let e49: vec3 = f0_4; let e62: vec3 = f0_4; f90_4 = clamp(dot(e62, vec3((50.0 * 0.33000001311302185))), 0.0, 1.0); let e75: vec3 = f0_4; let e76: f32 = f90_4; - let e77: f32 = LoH1; + let e77: f32 = LoH_1; let e78: vec3 = F_Schlick(e75, e76, e77); return e78; } -fn specular(f0_5: vec3, roughness4: f32, h1: vec3, NoV2: f32, NoL2: f32, NoH2: f32, LoH2: f32, specularIntensity: f32) -> vec3 { +fn specular(f0_5: vec3, roughness_4: f32, h_1: vec3, NoV_2: f32, NoL_2: f32, NoH_2: f32, LoH_2: f32, specularIntensity: f32) -> vec3 { var f0_6: vec3; - var roughness5: f32; - var NoV3: f32; - var NoL3: f32; - var NoH3: f32; - var LoH3: f32; - var specularIntensity1: f32; + var roughness_5: f32; + var NoV_3: f32; + var NoL_3: f32; + var NoH_3: f32; + var LoH_3: f32; + var specularIntensity_1: f32; var D: f32; var V: f32; var F: vec3; f0_6 = f0_5; - roughness5 = roughness4; - NoV3 = NoV2; - NoL3 = NoL2; - NoH3 = NoH2; - LoH3 = LoH2; - specularIntensity1 = specularIntensity; - let e57: f32 = roughness5; - let e58: f32 = NoH3; - let e59: f32 = D_GGX(e57, e58, h1); + roughness_5 = roughness_4; + NoV_3 = NoV_2; + NoL_3 = NoL_2; + NoH_3 = NoH_2; + LoH_3 = LoH_2; + specularIntensity_1 = specularIntensity; + let e57: f32 = roughness_5; + let e58: f32 = NoH_3; + let e59: f32 = D_GGX(e57, e58, h_1); D = e59; - let e64: f32 = roughness5; - let e65: f32 = NoV3; - let e66: f32 = NoL3; + let e64: f32 = roughness_5; + let e65: f32 = NoV_3; + let e66: f32 = NoL_3; let e67: f32 = V_SmithGGXCorrelated(e64, e65, e66); V = e67; let e71: vec3 = f0_6; - let e72: f32 = LoH3; + let e72: f32 = LoH_3; let e73: vec3 = fresnel(e71, e72); F = e73; - let e75: f32 = specularIntensity1; + let e75: f32 = specularIntensity_1; let e76: f32 = D; let e78: f32 = V; let e80: vec3 = F; return (((e75 * e76) * e78) * e80); } -fn Fd_Burley(roughness6: f32, NoV4: f32, NoL4: f32, LoH4: f32) -> f32 { - var roughness7: f32; - var NoV5: f32; - var NoL5: f32; - var LoH5: f32; +fn Fd_Burley(roughness_6: f32, NoV_4: f32, NoL_4: f32, LoH_4: f32) -> f32 { + var roughness_7: f32; + var NoV_5: f32; + var NoL_5: f32; + var LoH_5: f32; var f90_5: f32; var lightScatter: f32; var viewScatter: f32; - roughness7 = roughness6; - NoV5 = NoV4; - NoL5 = NoL4; - LoH5 = LoH4; - let e50: f32 = roughness7; - let e52: f32 = LoH5; - let e54: f32 = LoH5; + roughness_7 = roughness_6; + NoV_5 = NoV_4; + NoL_5 = NoL_4; + LoH_5 = LoH_4; + let e50: f32 = roughness_7; + let e52: f32 = LoH_5; + let e54: f32 = LoH_5; f90_5 = (0.5 + (((2.0 * e50) * e52) * e54)); let e62: f32 = f90_5; - let e63: f32 = NoL5; - let e64: f32 = F_Schlick1(1.0, e62, e63); + let e63: f32 = NoL_5; + let e64: f32 = F_Schlick_1(1.0, e62, e63); lightScatter = e64; let e70: f32 = f90_5; - let e71: f32 = NoV5; - let e72: f32 = F_Schlick1(1.0, e70, e71); + let e71: f32 = NoV_5; + let e72: f32 = F_Schlick_1(1.0, e70, e71); viewScatter = e72; let e74: f32 = lightScatter; let e75: f32 = viewScatter; return ((e74 * e75) * (1.0 / 3.1415927410125732)); } -fn EnvBRDFApprox(f0_7: vec3, perceptual_roughness: f32, NoV6: f32) -> vec3 { +fn EnvBRDFApprox(f0_7: vec3, perceptual_roughness: f32, NoV_6: f32) -> vec3 { var f0_8: vec3; - var perceptual_roughness1: f32; - var NoV7: f32; + var perceptual_roughness_1: f32; + var NoV_7: f32; var c0_: vec4 = vec4(-1.0, -0.027499999850988388, -0.5720000267028809, 0.02199999988079071); var c1_: vec4 = vec4(1.0, 0.042500000447034836, 1.0399999618530273, -0.03999999910593033); var r: vec4; @@ -339,20 +339,20 @@ fn EnvBRDFApprox(f0_7: vec3, perceptual_roughness: f32, NoV6: f32) -> vec3< var AB: vec2; f0_8 = f0_7; - perceptual_roughness1 = perceptual_roughness; - NoV7 = NoV6; - let e62: f32 = perceptual_roughness1; + perceptual_roughness_1 = perceptual_roughness; + NoV_7 = NoV_6; + let e62: f32 = perceptual_roughness_1; let e64: vec4 = c0_; let e66: vec4 = c1_; r = ((vec4(e62) * e64) + e66); let e69: vec4 = r; let e71: vec4 = r; - let e76: f32 = NoV7; - let e80: f32 = NoV7; + let e76: f32 = NoV_7; + let e80: f32 = NoV_7; let e83: vec4 = r; let e85: vec4 = r; - let e90: f32 = NoV7; - let e94: f32 = NoV7; + let e90: f32 = NoV_7; + let e94: f32 = NoV_7; let e98: vec4 = r; let e101: vec4 = r; a004_ = ((min((e83.x * e85.x), exp2((-(9.279999732971191) * e94))) * e98.x) + e101.y); @@ -366,11 +366,11 @@ fn EnvBRDFApprox(f0_7: vec3, perceptual_roughness: f32, NoV6: f32) -> vec3< } fn perceptualRoughnessToRoughness(perceptualRoughness: f32) -> f32 { - var perceptualRoughness1: f32; + var perceptualRoughness_1: f32; var clampedPerceptualRoughness: f32; - perceptualRoughness1 = perceptualRoughness; - let e45: f32 = perceptualRoughness1; + perceptualRoughness_1 = perceptualRoughness; + let e45: f32 = perceptualRoughness_1; clampedPerceptualRoughness = clamp(e45, 0.08900000154972076, 1.0); let e50: f32 = clampedPerceptualRoughness; let e51: f32 = clampedPerceptualRoughness; @@ -378,152 +378,152 @@ fn perceptualRoughnessToRoughness(perceptualRoughness: f32) -> f32 { } fn reinhard(color: vec3) -> vec3 { - var color1: vec3; + var color_1: vec3; - color1 = color; - let e42: vec3 = color1; - let e45: vec3 = color1; + color_1 = color; + let e42: vec3 = color_1; + let e45: vec3 = color_1; return (e42 / (vec3(1.0) + e45)); } -fn reinhard_extended(color2: vec3, max_white: f32) -> vec3 { - var color3: vec3; - var max_white1: f32; +fn reinhard_extended(color_2: vec3, max_white: f32) -> vec3 { + var color_3: vec3; + var max_white_1: f32; var numerator: vec3; - color3 = color2; - max_white1 = max_white; - let e44: vec3 = color3; - let e47: vec3 = color3; - let e48: f32 = max_white1; - let e49: f32 = max_white1; + color_3 = color_2; + max_white_1 = max_white; + let e44: vec3 = color_3; + let e47: vec3 = color_3; + let e48: f32 = max_white_1; + let e49: f32 = max_white_1; numerator = (e44 * (vec3(1.0) + (e47 / vec3((e48 * e49))))); let e56: vec3 = numerator; - let e59: vec3 = color3; + let e59: vec3 = color_3; return (e56 / (vec3(1.0) + e59)); } -fn luminance(v1: vec3) -> f32 { - var v2: vec3; +fn luminance(v_1: vec3) -> f32 { + var v_2: vec3; - v2 = v1; - let e47: vec3 = v2; + v_2 = v_1; + let e47: vec3 = v_2; return dot(e47, vec3(0.2125999927520752, 0.7152000069618225, 0.0722000002861023)); } fn change_luminance(c_in: vec3, l_out: f32) -> vec3 { - var c_in1: vec3; - var l_out1: f32; + var c_in_1: vec3; + var l_out_1: f32; var l_in: f32; - c_in1 = c_in; - l_out1 = l_out; - let e45: vec3 = c_in1; + c_in_1 = c_in; + l_out_1 = l_out; + let e45: vec3 = c_in_1; let e46: f32 = luminance(e45); l_in = e46; - let e48: vec3 = c_in1; - let e49: f32 = l_out1; + let e48: vec3 = c_in_1; + let e49: f32 = l_out_1; let e50: f32 = l_in; return (e48 * (e49 / e50)); } -fn reinhard_luminance(color4: vec3) -> vec3 { - var color5: vec3; +fn reinhard_luminance(color_4: vec3) -> vec3 { + var color_5: vec3; var l_old: f32; var l_new: f32; - color5 = color4; - let e43: vec3 = color5; + color_5 = color_4; + let e43: vec3 = color_5; let e44: f32 = luminance(e43); l_old = e44; let e46: f32 = l_old; let e48: f32 = l_old; l_new = (e46 / (1.0 + e48)); - let e54: vec3 = color5; + let e54: vec3 = color_5; let e55: f32 = l_new; let e56: vec3 = change_luminance(e54, e55); return e56; } -fn reinhard_extended_luminance(color6: vec3, max_white_l: f32) -> vec3 { - var color7: vec3; - var max_white_l1: f32; - var l_old1: f32; - var numerator1: f32; - var l_new1: f32; +fn reinhard_extended_luminance(color_6: vec3, max_white_l: f32) -> vec3 { + var color_7: vec3; + var max_white_l_1: f32; + var l_old_1: f32; + var numerator_1: f32; + var l_new_1: f32; - color7 = color6; - max_white_l1 = max_white_l; - let e45: vec3 = color7; + color_7 = color_6; + max_white_l_1 = max_white_l; + let e45: vec3 = color_7; let e46: f32 = luminance(e45); - l_old1 = e46; - let e48: f32 = l_old1; - let e50: f32 = l_old1; - let e51: f32 = max_white_l1; - let e52: f32 = max_white_l1; - numerator1 = (e48 * (1.0 + (e50 / (e51 * e52)))); - let e58: f32 = numerator1; - let e60: f32 = l_old1; - l_new1 = (e58 / (1.0 + e60)); - let e66: vec3 = color7; - let e67: f32 = l_new1; + l_old_1 = e46; + let e48: f32 = l_old_1; + let e50: f32 = l_old_1; + let e51: f32 = max_white_l_1; + let e52: f32 = max_white_l_1; + numerator_1 = (e48 * (1.0 + (e50 / (e51 * e52)))); + let e58: f32 = numerator_1; + let e60: f32 = l_old_1; + l_new_1 = (e58 / (1.0 + e60)); + let e66: vec3 = color_7; + let e67: f32 = l_new_1; let e68: vec3 = change_luminance(e66, e67); return e68; } -fn point_light(light: PointLight, roughness8: f32, NdotV: f32, N: vec3, V1: vec3, R: vec3, F0_: vec3, diffuseColor: vec3) -> vec3 { - var light1: PointLight; - var roughness9: f32; - var NdotV1: f32; - var N1: vec3; - var V2: vec3; - var R1: vec3; +fn point_light(light: PointLight, roughness_8: f32, NdotV: f32, N: vec3, V_1: vec3, R: vec3, F0_: vec3, diffuseColor: vec3) -> vec3 { + var light_1: PointLight; + var roughness_9: f32; + var NdotV_1: f32; + var N_1: vec3; + var V_2: vec3; + var R_1: vec3; var F0_1: vec3; - var diffuseColor1: vec3; + var diffuseColor_1: vec3; var light_to_frag: vec3; var distance_square: f32; var rangeAttenuation: f32; - var a1: f32; + var a_1: f32; var radius: f32; var centerToRay: vec3; var closestPoint: vec3; var LspecLengthInverse: f32; var normalizationFactor: f32; - var specularIntensity2: f32; + var specularIntensity_2: f32; var L: vec3; var H: vec3; - var NoL6: f32; - var NoH4: f32; - var LoH6: f32; - var specular1: vec3; + var NoL_6: f32; + var NoH_4: f32; + var LoH_6: f32; + var specular_1: vec3; var diffuse: vec3; - light1 = light; - roughness9 = roughness8; - NdotV1 = NdotV; - N1 = N; - V2 = V1; - R1 = R; + light_1 = light; + roughness_9 = roughness_8; + NdotV_1 = NdotV; + N_1 = N; + V_2 = V_1; + R_1 = R; F0_1 = F0_; - diffuseColor1 = diffuseColor; - let e56: PointLight = light1; - let e59: vec3 = v_WorldPosition1; + diffuseColor_1 = diffuseColor; + let e56: PointLight = light_1; + let e59: vec3 = v_WorldPosition_1; light_to_frag = (e56.pos.xyz - e59.xyz); let e65: vec3 = light_to_frag; let e66: vec3 = light_to_frag; distance_square = dot(e65, e66); - let e70: PointLight = light1; + let e70: PointLight = light_1; let e73: f32 = distance_square; - let e74: PointLight = light1; + let e74: PointLight = light_1; let e77: f32 = getDistanceAttenuation(e73, e74.lightParams.x); rangeAttenuation = e77; - let e79: f32 = roughness9; - a1 = e79; - let e81: PointLight = light1; + let e79: f32 = roughness_9; + a_1 = e79; + let e81: PointLight = light_1; radius = e81.lightParams.y; let e87: vec3 = light_to_frag; - let e88: vec3 = R1; - let e90: vec3 = R1; + let e88: vec3 = R_1; + let e90: vec3 = R_1; let e92: vec3 = light_to_frag; centerToRay = ((dot(e87, e88) * e90) - e92); let e95: vec3 = light_to_frag; @@ -544,213 +544,213 @@ fn point_light(light: PointLight, roughness8: f32, NdotV: f32, N: vec3, V1: let e138: vec3 = closestPoint; let e139: vec3 = closestPoint; LspecLengthInverse = inverseSqrt(dot(e138, e139)); - let e143: f32 = a1; - let e144: f32 = a1; + let e143: f32 = a_1; + let e144: f32 = a_1; let e145: f32 = radius; let e148: f32 = LspecLengthInverse; - let e153: f32 = a1; + let e153: f32 = a_1; let e154: f32 = radius; let e157: f32 = LspecLengthInverse; normalizationFactor = (e143 / clamp((e153 + ((e154 * 0.5) * e157)), 0.0, 1.0)); let e165: f32 = normalizationFactor; let e166: f32 = normalizationFactor; - specularIntensity2 = (e165 * e166); + specularIntensity_2 = (e165 * e166); let e169: vec3 = closestPoint; let e170: f32 = LspecLengthInverse; L = (e169 * e170); let e173: vec3 = L; - let e174: vec3 = V2; + let e174: vec3 = V_2; let e176: vec3 = L; - let e177: vec3 = V2; + let e177: vec3 = V_2; H = normalize((e176 + e177)); - let e183: vec3 = N1; + let e183: vec3 = N_1; let e184: vec3 = L; - let e190: vec3 = N1; + let e190: vec3 = N_1; let e191: vec3 = L; - NoL6 = clamp(dot(e190, e191), 0.0, 1.0); - let e199: vec3 = N1; + NoL_6 = clamp(dot(e190, e191), 0.0, 1.0); + let e199: vec3 = N_1; let e200: vec3 = H; - let e206: vec3 = N1; + let e206: vec3 = N_1; let e207: vec3 = H; - NoH4 = clamp(dot(e206, e207), 0.0, 1.0); + NoH_4 = clamp(dot(e206, e207), 0.0, 1.0); let e215: vec3 = L; let e216: vec3 = H; let e222: vec3 = L; let e223: vec3 = H; - LoH6 = clamp(dot(e222, e223), 0.0, 1.0); + LoH_6 = clamp(dot(e222, e223), 0.0, 1.0); let e237: vec3 = F0_1; - let e238: f32 = roughness9; + let e238: f32 = roughness_9; let e239: vec3 = H; - let e240: f32 = NdotV1; - let e241: f32 = NoL6; - let e242: f32 = NoH4; - let e243: f32 = LoH6; - let e244: f32 = specularIntensity2; + let e240: f32 = NdotV_1; + let e241: f32 = NoL_6; + let e242: f32 = NoH_4; + let e243: f32 = LoH_6; + let e244: f32 = specularIntensity_2; let e245: vec3 = specular(e237, e238, e239, e240, e241, e242, e243, e244); - specular1 = e245; + specular_1 = e245; let e248: vec3 = light_to_frag; L = normalize(e248); let e250: vec3 = L; - let e251: vec3 = V2; + let e251: vec3 = V_2; let e253: vec3 = L; - let e254: vec3 = V2; + let e254: vec3 = V_2; H = normalize((e253 + e254)); - let e259: vec3 = N1; + let e259: vec3 = N_1; let e260: vec3 = L; - let e266: vec3 = N1; + let e266: vec3 = N_1; let e267: vec3 = L; - NoL6 = clamp(dot(e266, e267), 0.0, 1.0); - let e274: vec3 = N1; + NoL_6 = clamp(dot(e266, e267), 0.0, 1.0); + let e274: vec3 = N_1; let e275: vec3 = H; - let e281: vec3 = N1; + let e281: vec3 = N_1; let e282: vec3 = H; - NoH4 = clamp(dot(e281, e282), 0.0, 1.0); + NoH_4 = clamp(dot(e281, e282), 0.0, 1.0); let e289: vec3 = L; let e290: vec3 = H; let e296: vec3 = L; let e297: vec3 = H; - LoH6 = clamp(dot(e296, e297), 0.0, 1.0); - let e302: vec3 = diffuseColor1; - let e307: f32 = roughness9; - let e308: f32 = NdotV1; - let e309: f32 = NoL6; - let e310: f32 = LoH6; + LoH_6 = clamp(dot(e296, e297), 0.0, 1.0); + let e302: vec3 = diffuseColor_1; + let e307: f32 = roughness_9; + let e308: f32 = NdotV_1; + let e309: f32 = NoL_6; + let e310: f32 = LoH_6; let e311: f32 = Fd_Burley(e307, e308, e309, e310); diffuse = (e302 * e311); let e314: vec3 = diffuse; - let e315: vec3 = specular1; - let e317: PointLight = light1; + let e315: vec3 = specular_1; + let e317: PointLight = light_1; let e321: f32 = rangeAttenuation; - let e322: f32 = NoL6; + let e322: f32 = NoL_6; return (((e314 + e315) * e317.color.xyz) * (e321 * e322)); } -fn dir_light(light2: DirectionalLight, roughness10: f32, NdotV2: f32, normal: vec3, view: vec3, R2: vec3, F0_2: vec3, diffuseColor2: vec3) -> vec3 { - var light3: DirectionalLight; - var roughness11: f32; - var NdotV3: f32; - var normal1: vec3; - var view1: vec3; - var R3: vec3; +fn dir_light(light_2: DirectionalLight, roughness_10: f32, NdotV_2: f32, normal: vec3, view: vec3, R_2: vec3, F0_2: vec3, diffuseColor_2: vec3) -> vec3 { + var light_3: DirectionalLight; + var roughness_11: f32; + var NdotV_3: f32; + var normal_1: vec3; + var view_1: vec3; + var R_3: vec3; var F0_3: vec3; - var diffuseColor3: vec3; + var diffuseColor_3: vec3; var incident_light: vec3; var half_vector: vec3; - var NoL7: f32; - var NoH5: f32; - var LoH7: f32; - var diffuse1: vec3; - var specularIntensity3: f32 = 1.0; - var specular2: vec3; - - light3 = light2; - roughness11 = roughness10; - NdotV3 = NdotV2; - normal1 = normal; - view1 = view; - R3 = R2; + var NoL_7: f32; + var NoH_5: f32; + var LoH_7: f32; + var diffuse_1: vec3; + var specularIntensity_3: f32 = 1.0; + var specular_2: vec3; + + light_3 = light_2; + roughness_11 = roughness_10; + NdotV_3 = NdotV_2; + normal_1 = normal; + view_1 = view; + R_3 = R_2; F0_3 = F0_2; - diffuseColor3 = diffuseColor2; - let e56: DirectionalLight = light3; + diffuseColor_3 = diffuseColor_2; + let e56: DirectionalLight = light_3; incident_light = e56.direction.xyz; let e60: vec3 = incident_light; - let e61: vec3 = view1; + let e61: vec3 = view_1; let e63: vec3 = incident_light; - let e64: vec3 = view1; + let e64: vec3 = view_1; half_vector = normalize((e63 + e64)); - let e70: vec3 = normal1; + let e70: vec3 = normal_1; let e71: vec3 = incident_light; - let e77: vec3 = normal1; + let e77: vec3 = normal_1; let e78: vec3 = incident_light; - NoL7 = clamp(dot(e77, e78), 0.0, 1.0); - let e86: vec3 = normal1; + NoL_7 = clamp(dot(e77, e78), 0.0, 1.0); + let e86: vec3 = normal_1; let e87: vec3 = half_vector; - let e93: vec3 = normal1; + let e93: vec3 = normal_1; let e94: vec3 = half_vector; - NoH5 = clamp(dot(e93, e94), 0.0, 1.0); + NoH_5 = clamp(dot(e93, e94), 0.0, 1.0); let e102: vec3 = incident_light; let e103: vec3 = half_vector; let e109: vec3 = incident_light; let e110: vec3 = half_vector; - LoH7 = clamp(dot(e109, e110), 0.0, 1.0); - let e116: vec3 = diffuseColor3; - let e121: f32 = roughness11; - let e122: f32 = NdotV3; - let e123: f32 = NoL7; - let e124: f32 = LoH7; + LoH_7 = clamp(dot(e109, e110), 0.0, 1.0); + let e116: vec3 = diffuseColor_3; + let e121: f32 = roughness_11; + let e122: f32 = NdotV_3; + let e123: f32 = NoL_7; + let e124: f32 = LoH_7; let e125: f32 = Fd_Burley(e121, e122, e123, e124); - diffuse1 = (e116 * e125); + diffuse_1 = (e116 * e125); let e138: vec3 = F0_3; - let e139: f32 = roughness11; + let e139: f32 = roughness_11; let e140: vec3 = half_vector; - let e141: f32 = NdotV3; - let e142: f32 = NoL7; - let e143: f32 = NoH5; - let e144: f32 = LoH7; - let e145: f32 = specularIntensity3; + let e141: f32 = NdotV_3; + let e142: f32 = NoL_7; + let e143: f32 = NoH_5; + let e144: f32 = LoH_7; + let e145: f32 = specularIntensity_3; let e146: vec3 = specular(e138, e139, e140, e141, e142, e143, e144, e145); - specular2 = e146; - let e148: vec3 = specular2; - let e149: vec3 = diffuse1; - let e151: DirectionalLight = light3; - let e155: f32 = NoL7; + specular_2 = e146; + let e148: vec3 = specular_2; + let e149: vec3 = diffuse_1; + let e151: DirectionalLight = light_3; + let e155: f32 = NoL_7; return (((e148 + e149) * e151.color.xyz) * e155); } -fn main1() { +fn main_1() { var output_color: vec4; var metallic_roughness: vec4; var metallic: f32; - var perceptual_roughness2: f32; - var roughness12: f32; - var N2: vec3; + var perceptual_roughness_2: f32; + var roughness_12: f32; + var N_2: vec3; var T: vec3; var B: vec3; var TBN: mat3x3; var occlusion: f32; var emissive: vec4; - var V3: vec3; - var NdotV4: f32; + var V_3: vec3; + var NdotV_4: f32; var F0_4: vec3; - var diffuseColor4: vec3; - var R4: vec3; + var diffuseColor_4: vec3; + var R_4: vec3; var light_accum: vec3 = vec3(0.0, 0.0, 0.0); var i: i32 = 0; - var i1: i32 = 0; + var i_1: i32 = 0; var diffuse_ambient: vec3; var specular_ambient: vec3; - let e40: vec4 = global3.base_color; + let e40: vec4 = global_3.base_color; output_color = e40; let e42: vec4 = output_color; - let e44: vec2 = v_Uv1; + let e44: vec2 = v_Uv_1; let e45: vec4 = textureSample(StandardMaterial_base_color_texture, StandardMaterial_base_color_texture_sampler, e44); output_color = (e42 * e45); - let e48: vec2 = v_Uv1; + let e48: vec2 = v_Uv_1; let e49: vec4 = textureSample(StandardMaterial_metallic_roughness_texture, StandardMaterial_metallic_roughness_texture_sampler, e48); metallic_roughness = e49; - let e51: f32 = global5.metallic; + let e51: f32 = global_5.metallic; let e52: vec4 = metallic_roughness; metallic = (e51 * e52.z); - let e56: f32 = global4.perceptual_roughness; + let e56: f32 = global_4.perceptual_roughness; let e57: vec4 = metallic_roughness; - perceptual_roughness2 = (e56 * e57.y); - let e62: f32 = perceptual_roughness2; + perceptual_roughness_2 = (e56 * e57.y); + let e62: f32 = perceptual_roughness_2; let e63: f32 = perceptualRoughnessToRoughness(e62); - roughness12 = e63; - let e66: vec3 = v_WorldNormal1; - N2 = normalize(e66); - let e69: vec4 = v_WorldTangent1; - let e71: vec4 = v_WorldTangent1; + roughness_12 = e63; + let e66: vec3 = v_WorldNormal_1; + N_2 = normalize(e66); + let e69: vec4 = v_WorldTangent_1; + let e71: vec4 = v_WorldTangent_1; T = normalize(e71.xyz); - let e77: vec3 = N2; + let e77: vec3 = N_2; let e78: vec3 = T; - let e80: vec4 = v_WorldTangent1; + let e80: vec4 = v_WorldTangent_1; B = (cross(e77, e78) * e80.w); let e85: bool = gl_FrontFacing; - let e86: vec3 = N2; - let e87: vec3 = N2; - N2 = select(-(e87), e86, e85); + let e86: vec3 = N_2; + let e87: vec3 = N_2; + N_2 = select(-(e87), e86, e85); let e90: bool = gl_FrontFacing; let e91: vec3 = T; let e92: vec3 = T; @@ -761,53 +761,53 @@ fn main1() { B = select(-(e97), e96, e95); let e100: vec3 = T; let e101: vec3 = B; - let e102: vec3 = N2; + let e102: vec3 = N_2; TBN = mat3x3(vec3(e100.x, e100.y, e100.z), vec3(e101.x, e101.y, e101.z), vec3(e102.x, e102.y, e102.z)); let e117: mat3x3 = TBN; - let e119: vec2 = v_Uv1; + let e119: vec2 = v_Uv_1; let e120: vec4 = textureSample(StandardMaterial_normal_map, StandardMaterial_normal_map_sampler, e119); - let e128: vec2 = v_Uv1; + let e128: vec2 = v_Uv_1; let e129: vec4 = textureSample(StandardMaterial_normal_map, StandardMaterial_normal_map_sampler, e128); - N2 = (e117 * normalize(((e129.xyz * 2.0) - vec3(1.0)))); - let e139: vec2 = v_Uv1; + N_2 = (e117 * normalize(((e129.xyz * 2.0) - vec3(1.0)))); + let e139: vec2 = v_Uv_1; let e140: vec4 = textureSample(StandardMaterial_occlusion_texture, StandardMaterial_occlusion_texture_sampler, e139); occlusion = e140.x; - let e143: vec4 = global7.emissive; + let e143: vec4 = global_7.emissive; emissive = e143; let e145: vec4 = emissive; let e147: vec4 = emissive; - let e150: vec2 = v_Uv1; + let e150: vec2 = v_Uv_1; let e151: vec4 = textureSample(StandardMaterial_emissive_texture, StandardMaterial_emissive_texture_sampler, e150); let e153: vec3 = (e147.xyz * e151.xyz); emissive.x = e153.x; emissive.y = e153.y; emissive.z = e153.z; - let e160: vec4 = global1.CameraPos; - let e162: vec3 = v_WorldPosition1; - let e165: vec4 = global1.CameraPos; - let e167: vec3 = v_WorldPosition1; - V3 = normalize((e165.xyz - e167.xyz)); - let e174: vec3 = N2; - let e175: vec3 = V3; - let e180: vec3 = N2; - let e181: vec3 = V3; - NdotV4 = max(dot(e180, e181), 0.00009999999747378752); - let e187: f32 = global6.reflectance; - let e189: f32 = global6.reflectance; + let e160: vec4 = global_1.CameraPos; + let e162: vec3 = v_WorldPosition_1; + let e165: vec4 = global_1.CameraPos; + let e167: vec3 = v_WorldPosition_1; + V_3 = normalize((e165.xyz - e167.xyz)); + let e174: vec3 = N_2; + let e175: vec3 = V_3; + let e180: vec3 = N_2; + let e181: vec3 = V_3; + NdotV_4 = max(dot(e180, e181), 0.00009999999747378752); + let e187: f32 = global_6.reflectance; + let e189: f32 = global_6.reflectance; let e192: f32 = metallic; let e196: vec4 = output_color; let e198: f32 = metallic; F0_4 = (vec3((((0.1599999964237213 * e187) * e189) * (1.0 - e192))) + (e196.xyz * vec3(e198))); let e203: vec4 = output_color; let e206: f32 = metallic; - diffuseColor4 = (e203.xyz * vec3((1.0 - e206))); - let e211: vec3 = V3; - let e214: vec3 = V3; - let e216: vec3 = N2; - R4 = reflect(-(e214), e216); + diffuseColor_4 = (e203.xyz * vec3((1.0 - e206))); + let e211: vec3 = V_3; + let e214: vec3 = V_3; + let e216: vec3 = N_2; + R_4 = reflect(-(e214), e216); loop { let e224: i32 = i; - let e225: vec4 = global2.NumLights; + let e225: vec4 = global_2.NumLights; let e229: i32 = i; if (!(((e224 < i32(e225.x)) && (e229 < 10)))) { break; @@ -816,14 +816,14 @@ fn main1() { let e236: vec3 = light_accum; let e237: i32 = i; let e247: i32 = i; - let e249: PointLight = global2.PointLights[e247]; - let e250: f32 = roughness12; - let e251: f32 = NdotV4; - let e252: vec3 = N2; - let e253: vec3 = V3; - let e254: vec3 = R4; + let e249: PointLight = global_2.PointLights[e247]; + let e250: f32 = roughness_12; + let e251: f32 = NdotV_4; + let e252: vec3 = N_2; + let e253: vec3 = V_3; + let e254: vec3 = R_4; let e255: vec3 = F0_4; - let e256: vec3 = diffuseColor4; + let e256: vec3 = diffuseColor_4; let e257: vec3 = point_light(e249, e250, e251, e252, e253, e254, e255, e256); light_accum = (e236 + e257); } @@ -833,39 +833,39 @@ fn main1() { } } loop { - let e261: i32 = i1; - let e262: vec4 = global2.NumLights; - let e266: i32 = i1; + let e261: i32 = i_1; + let e262: vec4 = global_2.NumLights; + let e266: i32 = i_1; if (!(((e261 < i32(e262.y)) && (e266 < 1)))) { break; } { let e273: vec3 = light_accum; - let e274: i32 = i1; - let e284: i32 = i1; - let e286: DirectionalLight = global2.DirectionalLights[e284]; - let e287: f32 = roughness12; - let e288: f32 = NdotV4; - let e289: vec3 = N2; - let e290: vec3 = V3; - let e291: vec3 = R4; + let e274: i32 = i_1; + let e284: i32 = i_1; + let e286: DirectionalLight = global_2.DirectionalLights[e284]; + let e287: f32 = roughness_12; + let e288: f32 = NdotV_4; + let e289: vec3 = N_2; + let e290: vec3 = V_3; + let e291: vec3 = R_4; let e292: vec3 = F0_4; - let e293: vec3 = diffuseColor4; + let e293: vec3 = diffuseColor_4; let e294: vec3 = dir_light(e286, e287, e288, e289, e290, e291, e292, e293); light_accum = (e273 + e294); } continuing { - let e270: i32 = i1; - i1 = (e270 + 1); + let e270: i32 = i_1; + i_1 = (e270 + 1); } } - let e299: vec3 = diffuseColor4; - let e301: f32 = NdotV4; + let e299: vec3 = diffuseColor_4; + let e301: f32 = NdotV_4; let e302: vec3 = EnvBRDFApprox(e299, 1.0, e301); diffuse_ambient = e302; let e307: vec3 = F0_4; - let e308: f32 = perceptual_roughness2; - let e309: f32 = NdotV4; + let e308: f32 = perceptual_roughness_2; + let e309: f32 = NdotV_4; let e310: vec3 = EnvBRDFApprox(e307, e308, e309); specular_ambient = e310; let e312: vec4 = output_color; @@ -877,7 +877,7 @@ fn main1() { let e323: vec4 = output_color; let e325: vec3 = diffuse_ambient; let e326: vec3 = specular_ambient; - let e328: vec4 = global2.AmbientColor; + let e328: vec4 = global_2.AmbientColor; let e331: f32 = occlusion; let e333: vec3 = (e323.xyz + (((e325 + e326) * e328.xyz) * e331)); output_color.x = e333.x; @@ -905,12 +905,12 @@ fn main1() { [[stage(fragment)]] fn main([[location(0)]] v_WorldPosition: vec3, [[location(1)]] v_WorldNormal: vec3, [[location(2)]] v_Uv: vec2, [[location(3)]] v_WorldTangent: vec4, [[builtin(front_facing)]] param: bool) -> FragmentOutput { - v_WorldPosition1 = v_WorldPosition; - v_WorldNormal1 = v_WorldNormal; - v_Uv1 = v_Uv; - v_WorldTangent1 = v_WorldTangent; + v_WorldPosition_1 = v_WorldPosition; + v_WorldNormal_1 = v_WorldNormal; + v_Uv_1 = v_Uv; + v_WorldTangent_1 = v_WorldTangent; gl_FrontFacing = param; - main1(); + main_1(); let e72: vec4 = o_Target; return FragmentOutput(e72); } diff --git a/tests/out/wgsl/bevy-pbr-vert.wgsl b/tests/out/wgsl/bevy-pbr-vert.wgsl index 2f629ea89c..e448ca91fb 100644 --- a/tests/out/wgsl/bevy-pbr-vert.wgsl +++ b/tests/out/wgsl/bevy-pbr-vert.wgsl @@ -16,10 +16,10 @@ struct VertexOutput { [[builtin(position)]] member: vec4; }; -var Vertex_Position1: vec3; -var Vertex_Normal1: vec3; -var Vertex_Uv1: vec2; -var Vertex_Tangent1: vec4; +var Vertex_Position_1: vec3; +var Vertex_Normal_1: vec3; +var Vertex_Uv_1: vec2; +var Vertex_Tangent_1: vec4; var v_WorldPosition: vec3; var v_WorldNormal: vec3; var v_Uv: vec2; @@ -27,25 +27,25 @@ var v_Uv: vec2; var global: CameraViewProj; var v_WorldTangent: vec4; [[group(2), binding(0)]] -var global1: Transform; +var global_1: Transform; var gl_Position: vec4; -fn main1() { +fn main_1() { var world_position: vec4; - let e12: mat4x4 = global1.Model; - let e13: vec3 = Vertex_Position1; + let e12: mat4x4 = global_1.Model; + let e13: vec3 = Vertex_Position_1; world_position = (e12 * vec4(e13, 1.0)); let e18: vec4 = world_position; v_WorldPosition = e18.xyz; - let e20: mat4x4 = global1.Model; - let e28: vec3 = Vertex_Normal1; + let e20: mat4x4 = global_1.Model; + let e28: vec3 = Vertex_Normal_1; v_WorldNormal = (mat3x3(e20[0].xyz, e20[1].xyz, e20[2].xyz) * e28); - let e30: vec2 = Vertex_Uv1; + let e30: vec2 = Vertex_Uv_1; v_Uv = e30; - let e31: mat4x4 = global1.Model; - let e39: vec4 = Vertex_Tangent1; - let e42: vec4 = Vertex_Tangent1; + let e31: mat4x4 = global_1.Model; + let e39: vec4 = Vertex_Tangent_1; + let e42: vec4 = Vertex_Tangent_1; v_WorldTangent = vec4((mat3x3(e31[0].xyz, e31[1].xyz, e31[2].xyz) * e39.xyz), e42.w); let e46: mat4x4 = global.ViewProj; let e47: vec4 = world_position; @@ -55,11 +55,11 @@ fn main1() { [[stage(vertex)]] fn main([[location(0)]] Vertex_Position: vec3, [[location(1)]] Vertex_Normal: vec3, [[location(2)]] Vertex_Uv: vec2, [[location(3)]] Vertex_Tangent: vec4) -> VertexOutput { - Vertex_Position1 = Vertex_Position; - Vertex_Normal1 = Vertex_Normal; - Vertex_Uv1 = Vertex_Uv; - Vertex_Tangent1 = Vertex_Tangent; - main1(); + Vertex_Position_1 = Vertex_Position; + Vertex_Normal_1 = Vertex_Normal; + Vertex_Uv_1 = Vertex_Uv; + Vertex_Tangent_1 = Vertex_Tangent; + main_1(); let e29: vec3 = v_WorldPosition; let e31: vec3 = v_WorldNormal; let e33: vec2 = v_Uv; diff --git a/tests/out/wgsl/bits_glsl-frag.wgsl b/tests/out/wgsl/bits_glsl-frag.wgsl index 2eb77888ca..3efc019180 100644 --- a/tests/out/wgsl/bits_glsl-frag.wgsl +++ b/tests/out/wgsl/bits_glsl-frag.wgsl @@ -1,4 +1,4 @@ -fn main1() { +fn main_1() { var i: i32 = 0; var i2_: vec2 = vec2(0, 0); var i3_: vec3 = vec3(0, 0, 0); @@ -75,6 +75,6 @@ fn main1() { [[stage(fragment)]] fn main() { - main1(); + main_1(); return; } diff --git a/tests/out/wgsl/bool-select-frag.wgsl b/tests/out/wgsl/bool-select-frag.wgsl index 1ef8e94654..f1c4890d0d 100644 --- a/tests/out/wgsl/bool-select-frag.wgsl +++ b/tests/out/wgsl/bool-select-frag.wgsl @@ -5,30 +5,30 @@ struct FragmentOutput { var o_color: vec4; fn TevPerCompGT(a: f32, b: f32) -> f32 { - var a1: f32; - var b1: f32; + var a_1: f32; + var b_1: f32; - a1 = a; - b1 = b; - let e5: f32 = a1; - let e6: f32 = b1; + a_1 = a; + b_1 = b; + let e5: f32 = a_1; + let e6: f32 = b_1; return select(0.0, 1.0, (e5 > e6)); } -fn TevPerCompGT1(a2: vec3, b2: vec3) -> vec3 { - var a3: vec3; - var b3: vec3; +fn TevPerCompGT_1(a_2: vec3, b_2: vec3) -> vec3 { + var a_3: vec3; + var b_3: vec3; - a3 = a2; - b3 = b2; - let e7: vec3 = a3; - let e8: vec3 = b3; + a_3 = a_2; + b_3 = b_2; + let e7: vec3 = a_3; + let e8: vec3 = b_3; return select(vec3(0.0), vec3(1.0), (e7 > e8)); } -fn main1() { +fn main_1() { let e1: vec4 = o_color; - let e11: vec3 = TevPerCompGT1(vec3(3.0), vec3(5.0)); + let e11: vec3 = TevPerCompGT_1(vec3(3.0), vec3(5.0)); o_color.x = e11.x; o_color.y = e11.y; o_color.z = e11.z; @@ -39,7 +39,7 @@ fn main1() { [[stage(fragment)]] fn main() -> FragmentOutput { - main1(); + main_1(); let e3: vec4 = o_color; return FragmentOutput(e3); } diff --git a/tests/out/wgsl/clamp-splat-vert.wgsl b/tests/out/wgsl/clamp-splat-vert.wgsl index 4dfea0b084..cfdb9a50b5 100644 --- a/tests/out/wgsl/clamp-splat-vert.wgsl +++ b/tests/out/wgsl/clamp-splat-vert.wgsl @@ -2,19 +2,19 @@ struct VertexOutput { [[builtin(position)]] member: vec4; }; -var a_pos1: vec2; +var a_pos_1: vec2; var gl_Position: vec4; -fn main1() { - let e5: vec2 = a_pos1; +fn main_1() { + let e5: vec2 = a_pos_1; gl_Position = vec4(clamp(e5, vec2(0.0), vec2(1.0)), 0.0, 1.0); return; } [[stage(vertex)]] fn main([[location(0)]] a_pos: vec2) -> VertexOutput { - a_pos1 = a_pos; - main1(); + a_pos_1 = a_pos; + main_1(); let e5: vec4 = gl_Position; return VertexOutput(e5); } diff --git a/tests/out/wgsl/constant-array-size-vert.wgsl b/tests/out/wgsl/constant-array-size-vert.wgsl index 4987dae389..4fb8538b61 100644 --- a/tests/out/wgsl/constant-array-size-vert.wgsl +++ b/tests/out/wgsl/constant-array-size-vert.wgsl @@ -6,7 +6,7 @@ struct Data { [[group(1), binding(0)]] var global: Data; -fn function1() -> vec4 { +fn function_() -> vec4 { var sum: vec4 = vec4(0.0, 0.0, 0.0, 0.0); var i: i32 = 0; @@ -30,12 +30,12 @@ fn function1() -> vec4 { return e20; } -fn main1() { +fn main_1() { return; } [[stage(vertex)]] fn main() { - main1(); + main_1(); return; } diff --git a/tests/out/wgsl/empty-global-name-frag.wgsl b/tests/out/wgsl/empty-global-name-frag.wgsl index b3d73f14d1..55e55f8ad8 100644 --- a/tests/out/wgsl/empty-global-name-frag.wgsl +++ b/tests/out/wgsl/empty-global-name-frag.wgsl @@ -6,7 +6,7 @@ struct TextureData { [[group(1), binding(1)]] var global: TextureData; -fn main1() { +fn main_1() { var coords: vec2; let e2: vec4 = global.material; @@ -16,6 +16,6 @@ fn main1() { [[stage(fragment)]] fn main() { - main1(); + main_1(); return; } diff --git a/tests/out/wgsl/empty-global-name.wgsl b/tests/out/wgsl/empty-global-name.wgsl new file mode 100644 index 0000000000..ae85915b30 --- /dev/null +++ b/tests/out/wgsl/empty-global-name.wgsl @@ -0,0 +1,18 @@ +[[block]] +struct type_1 { + member: i32; +}; + +[[group(0), binding(0)]] +var unnamed: type_1; + +fn function_() { + let e8: i32 = unnamed.member; + unnamed.member = (e8 + 1); + return; +} + +[[stage(compute), workgroup_size(64, 1, 1)]] +fn main() { + function_(); +} diff --git a/tests/out/wgsl/expressions-frag.wgsl b/tests/out/wgsl/expressions-frag.wgsl index 8e13167506..899978fbb1 100644 --- a/tests/out/wgsl/expressions-frag.wgsl +++ b/tests/out/wgsl/expressions-frag.wgsl @@ -6,172 +6,172 @@ var global: f32; var o_color: vec4; fn testBinOpVecFloat(a: vec4, b: f32) { - var a1: vec4; - var b1: f32; + var a_1: vec4; + var b_1: f32; var v: vec4; - a1 = a; - b1 = b; - let e5: vec4 = a1; + a_1 = a; + b_1 = b; + let e5: vec4 = a_1; v = (e5 * 2.0); - let e8: vec4 = a1; + let e8: vec4 = a_1; v = (e8 / vec4(2.0)); - let e12: vec4 = a1; + let e12: vec4 = a_1; v = (e12 + vec4(2.0)); - let e16: vec4 = a1; + let e16: vec4 = a_1; v = (e16 - vec4(2.0)); return; } -fn testBinOpFloatVec(a2: vec4, b2: f32) { - var a3: vec4; - var b3: f32; - var v1: vec4; - - a3 = a2; - b3 = b2; - let e5: vec4 = a3; - let e6: f32 = b3; - v1 = (e5 * e6); - let e8: vec4 = a3; - let e9: f32 = b3; - v1 = (e8 / vec4(e9)); - let e12: vec4 = a3; - let e13: f32 = b3; - v1 = (e12 + vec4(e13)); - let e16: vec4 = a3; - let e17: f32 = b3; - v1 = (e16 - vec4(e17)); +fn testBinOpFloatVec(a_2: vec4, b_2: f32) { + var a_3: vec4; + var b_3: f32; + var v_1: vec4; + + a_3 = a_2; + b_3 = b_2; + let e5: vec4 = a_3; + let e6: f32 = b_3; + v_1 = (e5 * e6); + let e8: vec4 = a_3; + let e9: f32 = b_3; + v_1 = (e8 / vec4(e9)); + let e12: vec4 = a_3; + let e13: f32 = b_3; + v_1 = (e12 + vec4(e13)); + let e16: vec4 = a_3; + let e17: f32 = b_3; + v_1 = (e16 - vec4(e17)); return; } -fn testBinOpIVecInt(a4: vec4, b4: i32) { - var a5: vec4; - var b5: i32; - var v2: vec4; - - a5 = a4; - b5 = b4; - let e5: vec4 = a5; - let e6: i32 = b5; - v2 = (e5 * e6); - let e8: vec4 = a5; - let e9: i32 = b5; - v2 = (e8 / vec4(e9)); - let e12: vec4 = a5; - let e13: i32 = b5; - v2 = (e12 + vec4(e13)); - let e16: vec4 = a5; - let e17: i32 = b5; - v2 = (e16 - vec4(e17)); - let e20: vec4 = a5; - let e21: i32 = b5; - v2 = (e20 & vec4(e21)); - let e24: vec4 = a5; - let e25: i32 = b5; - v2 = (e24 | vec4(e25)); - let e28: vec4 = a5; - let e29: i32 = b5; - v2 = (e28 ^ vec4(e29)); - let e32: vec4 = a5; - let e33: i32 = b5; - v2 = (e32 >> vec4(u32(e33))); - let e37: vec4 = a5; - let e38: i32 = b5; - v2 = (e37 << vec4(u32(e38))); +fn testBinOpIVecInt(a_4: vec4, b_4: i32) { + var a_5: vec4; + var b_5: i32; + var v_2: vec4; + + a_5 = a_4; + b_5 = b_4; + let e5: vec4 = a_5; + let e6: i32 = b_5; + v_2 = (e5 * e6); + let e8: vec4 = a_5; + let e9: i32 = b_5; + v_2 = (e8 / vec4(e9)); + let e12: vec4 = a_5; + let e13: i32 = b_5; + v_2 = (e12 + vec4(e13)); + let e16: vec4 = a_5; + let e17: i32 = b_5; + v_2 = (e16 - vec4(e17)); + let e20: vec4 = a_5; + let e21: i32 = b_5; + v_2 = (e20 & vec4(e21)); + let e24: vec4 = a_5; + let e25: i32 = b_5; + v_2 = (e24 | vec4(e25)); + let e28: vec4 = a_5; + let e29: i32 = b_5; + v_2 = (e28 ^ vec4(e29)); + let e32: vec4 = a_5; + let e33: i32 = b_5; + v_2 = (e32 >> vec4(u32(e33))); + let e37: vec4 = a_5; + let e38: i32 = b_5; + v_2 = (e37 << vec4(u32(e38))); return; } -fn testBinOpIntIVec(a6: i32, b6: vec4) { - var a7: i32; - var b7: vec4; - var v3: vec4; - - a7 = a6; - b7 = b6; - let e5: i32 = a7; - let e6: vec4 = b7; - v3 = (e5 * e6); - let e8: i32 = a7; - let e9: vec4 = b7; - v3 = (vec4(e8) + e9); - let e12: i32 = a7; - let e13: vec4 = b7; - v3 = (vec4(e12) - e13); - let e16: i32 = a7; - let e17: vec4 = b7; - v3 = (vec4(e16) & e17); - let e20: i32 = a7; - let e21: vec4 = b7; - v3 = (vec4(e20) | e21); - let e24: i32 = a7; - let e25: vec4 = b7; - v3 = (vec4(e24) ^ e25); +fn testBinOpIntIVec(a_6: i32, b_6: vec4) { + var a_7: i32; + var b_7: vec4; + var v_3: vec4; + + a_7 = a_6; + b_7 = b_6; + let e5: i32 = a_7; + let e6: vec4 = b_7; + v_3 = (e5 * e6); + let e8: i32 = a_7; + let e9: vec4 = b_7; + v_3 = (vec4(e8) + e9); + let e12: i32 = a_7; + let e13: vec4 = b_7; + v_3 = (vec4(e12) - e13); + let e16: i32 = a_7; + let e17: vec4 = b_7; + v_3 = (vec4(e16) & e17); + let e20: i32 = a_7; + let e21: vec4 = b_7; + v_3 = (vec4(e20) | e21); + let e24: i32 = a_7; + let e25: vec4 = b_7; + v_3 = (vec4(e24) ^ e25); return; } -fn testBinOpUVecUint(a8: vec4, b8: u32) { - var a9: vec4; - var b9: u32; - var v4: vec4; - - a9 = a8; - b9 = b8; - let e5: vec4 = a9; - let e6: u32 = b9; - v4 = (e5 * e6); - let e8: vec4 = a9; - let e9: u32 = b9; - v4 = (e8 / vec4(e9)); - let e12: vec4 = a9; - let e13: u32 = b9; - v4 = (e12 + vec4(e13)); - let e16: vec4 = a9; - let e17: u32 = b9; - v4 = (e16 - vec4(e17)); - let e20: vec4 = a9; - let e21: u32 = b9; - v4 = (e20 & vec4(e21)); - let e24: vec4 = a9; - let e25: u32 = b9; - v4 = (e24 | vec4(e25)); - let e28: vec4 = a9; - let e29: u32 = b9; - v4 = (e28 ^ vec4(e29)); - let e32: vec4 = a9; - let e33: u32 = b9; - v4 = (e32 >> vec4(e33)); - let e36: vec4 = a9; - let e37: u32 = b9; - v4 = (e36 << vec4(e37)); +fn testBinOpUVecUint(a_8: vec4, b_8: u32) { + var a_9: vec4; + var b_9: u32; + var v_4: vec4; + + a_9 = a_8; + b_9 = b_8; + let e5: vec4 = a_9; + let e6: u32 = b_9; + v_4 = (e5 * e6); + let e8: vec4 = a_9; + let e9: u32 = b_9; + v_4 = (e8 / vec4(e9)); + let e12: vec4 = a_9; + let e13: u32 = b_9; + v_4 = (e12 + vec4(e13)); + let e16: vec4 = a_9; + let e17: u32 = b_9; + v_4 = (e16 - vec4(e17)); + let e20: vec4 = a_9; + let e21: u32 = b_9; + v_4 = (e20 & vec4(e21)); + let e24: vec4 = a_9; + let e25: u32 = b_9; + v_4 = (e24 | vec4(e25)); + let e28: vec4 = a_9; + let e29: u32 = b_9; + v_4 = (e28 ^ vec4(e29)); + let e32: vec4 = a_9; + let e33: u32 = b_9; + v_4 = (e32 >> vec4(e33)); + let e36: vec4 = a_9; + let e37: u32 = b_9; + v_4 = (e36 << vec4(e37)); return; } -fn testBinOpUintUVec(a10: u32, b10: vec4) { - var a11: u32; - var b11: vec4; - var v5: vec4; - - a11 = a10; - b11 = b10; - let e5: u32 = a11; - let e6: vec4 = b11; - v5 = (e5 * e6); - let e8: u32 = a11; - let e9: vec4 = b11; - v5 = (vec4(e8) + e9); - let e12: u32 = a11; - let e13: vec4 = b11; - v5 = (vec4(e12) - e13); - let e16: u32 = a11; - let e17: vec4 = b11; - v5 = (vec4(e16) & e17); - let e20: u32 = a11; - let e21: vec4 = b11; - v5 = (vec4(e20) | e21); - let e24: u32 = a11; - let e25: vec4 = b11; - v5 = (vec4(e24) ^ e25); +fn testBinOpUintUVec(a_10: u32, b_10: vec4) { + var a_11: u32; + var b_11: vec4; + var v_5: vec4; + + a_11 = a_10; + b_11 = b_10; + let e5: u32 = a_11; + let e6: vec4 = b_11; + v_5 = (e5 * e6); + let e8: u32 = a_11; + let e9: vec4 = b_11; + v_5 = (vec4(e8) + e9); + let e12: u32 = a_11; + let e13: vec4 = b_11; + v_5 = (vec4(e12) - e13); + let e16: u32 = a_11; + let e17: vec4 = b_11; + v_5 = (vec4(e16) & e17); + let e20: u32 = a_11; + let e21: vec4 = b_11; + v_5 = (vec4(e20) | e21); + let e24: u32 = a_11; + let e25: vec4 = b_11; + v_5 = (vec4(e24) ^ e25); return; } @@ -181,15 +181,15 @@ fn testStructConstructor() { } fn testArrayConstructor() { - var tree1: array = array(0.0); + var tree_1: array = array(0.0); } -fn privatePointer(a12: ptr) { +fn privatePointer(a_12: ptr) { return; } -fn main1() { +fn main_1() { var local: f32; let e3: f32 = global; @@ -208,6 +208,6 @@ fn main1() { [[stage(fragment)]] fn main() { - main1(); + main_1(); return; } diff --git a/tests/out/wgsl/fma-frag.wgsl b/tests/out/wgsl/fma-frag.wgsl index e943de29bc..9bab2da676 100644 --- a/tests/out/wgsl/fma-frag.wgsl +++ b/tests/out/wgsl/fma-frag.wgsl @@ -7,27 +7,27 @@ struct Mat4x3_ { var o_color: vec4; fn Fma(d: ptr, m: Mat4x3_, s: f32) { - var m1: Mat4x3_; - var s1: f32; + var m_1: Mat4x3_; + var s_1: f32; - m1 = m; - s1 = s; + m_1 = m; + s_1 = s; let e6: Mat4x3_ = (*d); - let e8: Mat4x3_ = m1; - let e10: f32 = s1; + let e8: Mat4x3_ = m_1; + let e10: f32 = s_1; (*d).mx = (e6.mx + (e8.mx * e10)); let e14: Mat4x3_ = (*d); - let e16: Mat4x3_ = m1; - let e18: f32 = s1; + let e16: Mat4x3_ = m_1; + let e18: f32 = s_1; (*d).my = (e14.my + (e16.my * e18)); let e22: Mat4x3_ = (*d); - let e24: Mat4x3_ = m1; - let e26: f32 = s1; + let e24: Mat4x3_ = m_1; + let e26: f32 = s_1; (*d).mz = (e22.mz + (e24.mz * e26)); return; } -fn main1() { +fn main_1() { let e1: vec4 = o_color; let e4: vec4 = vec4(1.0); o_color.x = e4.x; @@ -39,6 +39,6 @@ fn main1() { [[stage(fragment)]] fn main() { - main1(); + main_1(); return; } diff --git a/tests/out/wgsl/global-constant-array-vert.wgsl b/tests/out/wgsl/global-constant-array-vert.wgsl index 0e652c5f80..8fade8ae07 100644 --- a/tests/out/wgsl/global-constant-array-vert.wgsl +++ b/tests/out/wgsl/global-constant-array-vert.wgsl @@ -1,6 +1,6 @@ var i: u32; -fn main1() { +fn main_1() { var local: array = array(1.0, 2.0); let e2: u32 = i; @@ -8,6 +8,6 @@ fn main1() { [[stage(vertex)]] fn main() { - main1(); + main_1(); return; } diff --git a/tests/out/wgsl/image.wgsl b/tests/out/wgsl/image.wgsl index 34d642a2f5..631ca5db0f 100644 --- a/tests/out/wgsl/image.wgsl +++ b/tests/out/wgsl/image.wgsl @@ -46,11 +46,11 @@ fn main([[builtin(local_invocation_id)]] local_id: vec3) { } [[stage(compute), workgroup_size(16, 1, 1)]] -fn depth_load([[builtin(local_invocation_id)]] local_id1: vec3) { - let dim1: vec2 = textureDimensions(image_storage_src); - let itc1: vec2 = ((dim1 * vec2(local_id1.xy)) % vec2(10, 20)); - let val: f32 = textureLoad(image_depth_multisampled_src, itc1, i32(local_id1.z)); - textureStore(image_dst, itc1.x, vec4(u32(val))); +fn depth_load([[builtin(local_invocation_id)]] local_id_1: vec3) { + let dim_1: vec2 = textureDimensions(image_storage_src); + let itc_1: vec2 = ((dim_1 * vec2(local_id_1.xy)) % vec2(10, 20)); + let val: f32 = textureLoad(image_depth_multisampled_src, itc_1, i32(local_id_1.z)); + textureStore(image_dst, itc_1.x, vec4(u32(val))); return; } @@ -81,8 +81,8 @@ fn levels_queries() -> [[builtin(position)]] vec4 { let num_layers_cube: i32 = textureNumLayers(image_cube_array); let num_levels_3d: i32 = textureNumLevels(image_3d); let num_samples_aa: i32 = textureNumSamples(image_aa); - let sum1: i32 = (((((((num_layers_2d + num_layers_cube) + num_samples_aa) + num_levels_2d) + num_levels_2d_array) + num_levels_3d) + num_levels_cube) + num_levels_cube_array); - return vec4(f32(sum1)); + let sum_1: i32 = (((((((num_layers_2d + num_layers_cube) + num_samples_aa) + num_levels_2d) + num_levels_2d_array) + num_levels_3d) + num_levels_cube) + num_levels_cube_array); + return vec4(f32(sum_1)); } [[stage(fragment)]] @@ -98,8 +98,8 @@ fn sample() -> [[location(0)]] vec4 { [[stage(fragment)]] fn sample_comparison() -> [[location(0)]] f32 { - let tc1: vec2 = vec2(0.5); - let s2d_depth: f32 = textureSampleCompare(image_2d_depth, sampler_cmp, tc1, 0.5); - let s2d_depth_level: f32 = textureSampleCompareLevel(image_2d_depth, sampler_cmp, tc1, 0.5); + let tc_1: vec2 = vec2(0.5); + let s2d_depth: f32 = textureSampleCompare(image_2d_depth, sampler_cmp, tc_1, 0.5); + let s2d_depth_level: f32 = textureSampleCompareLevel(image_2d_depth, sampler_cmp, tc_1, 0.5); return (s2d_depth + s2d_depth_level); } diff --git a/tests/out/wgsl/interface.wgsl b/tests/out/wgsl/interface.wgsl index c86c9f5564..f576915f35 100644 --- a/tests/out/wgsl/interface.wgsl +++ b/tests/out/wgsl/interface.wgsl @@ -20,8 +20,8 @@ fn vertex([[builtin(vertex_index)]] vertex_index: u32, [[builtin(instance_index) [[stage(fragment)]] fn fragment(in: VertexOutput, [[builtin(front_facing)]] front_facing: bool, [[builtin(sample_index)]] sample_index: u32, [[builtin(sample_mask)]] sample_mask: u32) -> FragmentOutput { let mask: u32 = (sample_mask & (1u << sample_index)); - let color1: f32 = select(0.0, 1.0, front_facing); - return FragmentOutput(in.varying, mask, color1); + let color_1: f32 = select(0.0, 1.0, front_facing); + return FragmentOutput(in.varying, mask, color_1); } [[stage(compute), workgroup_size(1, 1, 1)]] diff --git a/tests/out/wgsl/interpolate.wgsl b/tests/out/wgsl/interpolate.wgsl index 972bc25231..91b935db17 100644 --- a/tests/out/wgsl/interpolate.wgsl +++ b/tests/out/wgsl/interpolate.wgsl @@ -26,6 +26,6 @@ fn main() -> FragmentInput { } [[stage(fragment)]] -fn main1(val: FragmentInput) { +fn main_1(val: FragmentInput) { return; } diff --git a/tests/out/wgsl/inv-hyperbolic-trig-functions.wgsl b/tests/out/wgsl/inv-hyperbolic-trig-functions.wgsl index ff4d9fa0ea..370bab0475 100644 --- a/tests/out/wgsl/inv-hyperbolic-trig-functions.wgsl +++ b/tests/out/wgsl/inv-hyperbolic-trig-functions.wgsl @@ -1,6 +1,6 @@ var a: f32; -fn main1() { +fn main_1() { var b: f32; var c: f32; var d: f32; @@ -16,5 +16,5 @@ fn main1() { [[stage(vertex)]] fn main() { - main1(); + main_1(); } diff --git a/tests/out/wgsl/long-form-matrix-vert.wgsl b/tests/out/wgsl/long-form-matrix-vert.wgsl index 9806b11850..60f702df6b 100644 --- a/tests/out/wgsl/long-form-matrix-vert.wgsl +++ b/tests/out/wgsl/long-form-matrix-vert.wgsl @@ -1,4 +1,4 @@ -fn main1() { +fn main_1() { var splat: mat2x2 = mat2x2(vec2(1.0, 0.0), vec2(0.0, 1.0)); var normal: mat2x2 = mat2x2(vec2(1.0, 1.0), vec2(2.0, 2.0)); var a: mat2x2 = mat2x2(vec2(1.0, 2.0), vec2(3.0, 4.0)); @@ -25,6 +25,6 @@ fn main1() { [[stage(vertex)]] fn main() { - main1(); + main_1(); return; } diff --git a/tests/out/wgsl/math-functions-vert.wgsl b/tests/out/wgsl/math-functions-vert.wgsl index 33a8f909e7..f7f3c26bed 100644 --- a/tests/out/wgsl/math-functions-vert.wgsl +++ b/tests/out/wgsl/math-functions-vert.wgsl @@ -1,4 +1,4 @@ -fn main1() { +fn main_1() { var a: vec4 = vec4(1.0, 1.0, 1.0, 1.0); var b: vec4 = vec4(2.0, 2.0, 2.0, 2.0); var m: mat4x4; @@ -149,6 +149,6 @@ fn main1() { [[stage(vertex)]] fn main() { - main1(); + main_1(); return; } diff --git a/tests/out/wgsl/operators.wgsl b/tests/out/wgsl/operators.wgsl index b3f7bba03a..17985a6c10 100644 --- a/tests/out/wgsl/operators.wgsl +++ b/tests/out/wgsl/operators.wgsl @@ -47,8 +47,8 @@ fn constructors() -> f32 { } fn modulo() { - let a1: i32 = (1 % 1); - let b1: f32 = (1.0 % 1.0); + let a_1: i32 = (1 % 1); + let b_1: f32 = (1.0 % 1.0); let c: vec3 = (vec3(1) % vec3(1)); let d: vec3 = (vec3(1.0) % vec3(1.0)); } diff --git a/tests/out/wgsl/pointers.wgsl b/tests/out/wgsl/pointers.wgsl index cabe2eaedf..0979097b95 100644 --- a/tests/out/wgsl/pointers.wgsl +++ b/tests/out/wgsl/pointers.wgsl @@ -1,6 +1,6 @@ [[block]] struct DynamicArray { - array1: [[stride(4)]] array; + array_: [[stride(4)]] array; }; fn f() { @@ -11,9 +11,9 @@ fn f() { return; } -fn index_dynamic_array(p: ptr, i: i32, v1: u32) -> u32 { - let old: u32 = (*p).array1[i]; - (*p).array1[i] = v1; +fn index_dynamic_array(p: ptr, i: i32, v_1: u32) -> u32 { + let old: u32 = (*p).array_[i]; + (*p).array_[i] = v_1; return old; } diff --git a/tests/out/wgsl/prepostfix-frag.wgsl b/tests/out/wgsl/prepostfix-frag.wgsl index 0aef32967b..9c4a4e831b 100644 --- a/tests/out/wgsl/prepostfix-frag.wgsl +++ b/tests/out/wgsl/prepostfix-frag.wgsl @@ -1,10 +1,10 @@ -fn main1() { +fn main_1() { var scalar_target: i32; var scalar: i32 = 1; var vec_target: vec2; - var vec1: vec2 = vec2(1u, 1u); + var vec_: vec2 = vec2(1u, 1u); var mat_target: mat4x3; - var mat1: 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)); + 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: i32 = scalar; scalar = (e3 + 1); @@ -13,28 +13,28 @@ fn main1() { let e8: i32 = (e6 - 1); scalar = e8; scalar_target = e8; - let e14: vec2 = vec1; - vec1 = (e14 - vec2(1u)); + let e14: vec2 = vec_; + vec_ = (e14 - vec2(1u)); vec_target = e14; - let e18: vec2 = vec1; + let e18: vec2 = vec_; let e21: vec2 = (e18 + vec2(1u)); - vec1 = e21; + vec_ = e21; vec_target = e21; let e24: f32 = f32(1); - let e32: mat4x3 = mat1; + let e32: mat4x3 = mat_; let e34: vec3 = vec3(1.0); - mat1 = (e32 + mat4x3(e34, e34, e34, e34)); + mat_ = (e32 + mat4x3(e34, e34, e34, e34)); mat_target = e32; - let e37: mat4x3 = mat1; + let e37: mat4x3 = mat_; let e39: vec3 = vec3(1.0); let e41: mat4x3 = (e37 - mat4x3(e39, e39, e39, e39)); - mat1 = e41; + mat_ = e41; mat_target = e41; return; } [[stage(fragment)]] fn main() { - main1(); + main_1(); return; } diff --git a/tests/out/wgsl/quad-vert.wgsl b/tests/out/wgsl/quad-vert.wgsl index 8516563d19..8bde114859 100644 --- a/tests/out/wgsl/quad-vert.wgsl +++ b/tests/out/wgsl/quad-vert.wgsl @@ -9,23 +9,23 @@ struct VertexOutput { }; var v_uv: vec2; -var a_uv1: vec2; +var a_uv_1: vec2; var perVertexStruct: gl_PerVertex = gl_PerVertex(vec4(0.0, 0.0, 0.0, 1.0), ); -var a_pos1: vec2; +var a_pos_1: vec2; -fn main1() { - let e12: vec2 = a_uv1; +fn main_1() { + let e12: vec2 = a_uv_1; v_uv = e12; - let e13: vec2 = a_pos1; + let e13: vec2 = a_pos_1; perVertexStruct.gl_Position = vec4(e13.x, e13.y, 0.0, 1.0); return; } [[stage(vertex)]] fn main([[location(1)]] a_uv: vec2, [[location(0)]] a_pos: vec2) -> VertexOutput { - a_uv1 = a_uv; - a_pos1 = a_pos; - main1(); + a_uv_1 = a_uv; + a_pos_1 = a_pos; + main_1(); let e7: vec2 = v_uv; let e8: vec4 = perVertexStruct.gl_Position; return VertexOutput(e7, e8); diff --git a/tests/out/wgsl/quad.wgsl b/tests/out/wgsl/quad.wgsl index 9fccc34b49..0b8720927d 100644 --- a/tests/out/wgsl/quad.wgsl +++ b/tests/out/wgsl/quad.wgsl @@ -16,8 +16,8 @@ fn main([[location(0)]] pos: vec2, [[location(1)]] uv: vec2) -> Vertex } [[stage(fragment)]] -fn main1([[location(0)]] uv1: vec2) -> [[location(0)]] vec4 { - let color: vec4 = textureSample(u_texture, u_sampler, uv1); +fn main_1([[location(0)]] uv_1: vec2) -> [[location(0)]] vec4 { + let color: vec4 = textureSample(u_texture, u_sampler, uv_1); if ((color.w == 0.0)) { discard; } diff --git a/tests/out/wgsl/quad_glsl-frag.wgsl b/tests/out/wgsl/quad_glsl-frag.wgsl index 022cc70ad5..5381123847 100644 --- a/tests/out/wgsl/quad_glsl-frag.wgsl +++ b/tests/out/wgsl/quad_glsl-frag.wgsl @@ -2,18 +2,18 @@ struct FragmentOutput { [[location(0)]] o_color: vec4; }; -var v_uv1: vec2; +var v_uv_1: vec2; var o_color: vec4; -fn main1() { +fn main_1() { o_color = vec4(1.0, 1.0, 1.0, 1.0); return; } [[stage(fragment)]] fn main([[location(0)]] v_uv: vec2) -> FragmentOutput { - v_uv1 = v_uv; - main1(); + v_uv_1 = v_uv; + main_1(); let e7: vec4 = o_color; return FragmentOutput(e7); } diff --git a/tests/out/wgsl/quad_glsl-vert.wgsl b/tests/out/wgsl/quad_glsl-vert.wgsl index 81c1555648..1348b9a4ab 100644 --- a/tests/out/wgsl/quad_glsl-vert.wgsl +++ b/tests/out/wgsl/quad_glsl-vert.wgsl @@ -3,24 +3,24 @@ struct VertexOutput { [[builtin(position)]] member: vec4; }; -var a_pos1: vec2; -var a_uv1: vec2; +var a_pos_1: vec2; +var a_uv_1: vec2; var v_uv: vec2; var gl_Position: vec4; -fn main1() { - let e4: vec2 = a_uv1; +fn main_1() { + let e4: vec2 = a_uv_1; v_uv = e4; - let e6: vec2 = a_pos1; + let e6: vec2 = a_pos_1; gl_Position = vec4((1.2000000476837158 * e6), 0.0, 1.0); return; } [[stage(vertex)]] fn main([[location(0)]] a_pos: vec2, [[location(1)]] a_uv: vec2) -> VertexOutput { - a_pos1 = a_pos; - a_uv1 = a_uv; - main1(); + a_pos_1 = a_pos; + a_uv_1 = a_uv; + main_1(); let e14: vec2 = v_uv; let e16: vec4 = gl_Position; return VertexOutput(e14, e16); diff --git a/tests/out/wgsl/samplers-frag.wgsl b/tests/out/wgsl/samplers-frag.wgsl index 016b87693b..670db9f82e 100644 --- a/tests/out/wgsl/samplers-frag.wgsl +++ b/tests/out/wgsl/samplers-frag.wgsl @@ -26,331 +26,331 @@ var texCubeArrayShadow: texture_depth_cube_array; var tex3DShadow: texture_3d; [[group(1), binding(17)]] var sampShadow: sampler_comparison; -var texcoord1: vec4; +var texcoord_1: vec4; fn testTex1D(coord: f32) { - var coord1: f32; + var coord_1: f32; var c: vec4; - coord1 = coord; - let e18: f32 = coord1; + coord_1 = coord; + let e18: f32 = coord_1; let e19: vec4 = textureSample(tex1D, samp, e18); c = e19; - let e22: f32 = coord1; + let e22: f32 = coord_1; let e24: vec4 = textureSampleBias(tex1D, samp, e22, 2.0); c = e24; - let e28: f32 = coord1; + let e28: f32 = coord_1; let e31: vec4 = textureSampleGrad(tex1D, samp, e28, 4.0, 4.0); c = e31; - let e36: f32 = coord1; + let e36: f32 = coord_1; let e40: vec4 = textureSampleGrad(tex1D, samp, e36, 4.0, 4.0, 5); c = e40; - let e43: f32 = coord1; + let e43: f32 = coord_1; let e45: vec4 = textureSampleLevel(tex1D, samp, e43, 3.0); c = e45; - let e49: f32 = coord1; + let e49: f32 = coord_1; let e52: vec4 = textureSampleLevel(tex1D, samp, e49, 3.0, 5); c = e52; - let e55: f32 = coord1; + let e55: f32 = coord_1; let e57: vec4 = textureSample(tex1D, samp, e55, 5); c = e57; - let e61: f32 = coord1; + let e61: f32 = coord_1; let e64: vec4 = textureSampleBias(tex1D, samp, e61, 2.0, 5); c = e64; - let e65: f32 = coord1; - let e68: f32 = coord1; + let e65: f32 = coord_1; + let e68: f32 = coord_1; let e70: vec2 = vec2(e68, 6.0); let e74: vec4 = textureSample(tex1D, samp, (e70.x / e70.y)); c = e74; - let e75: f32 = coord1; - let e80: f32 = coord1; + let e75: f32 = coord_1; + let e80: f32 = coord_1; let e84: vec4 = vec4(e80, 0.0, 0.0, 6.0); let e90: vec4 = textureSample(tex1D, samp, (e84.xyz / vec3(e84.w)).x); c = e90; - let e91: f32 = coord1; - let e95: f32 = coord1; + let e91: f32 = coord_1; + let e95: f32 = coord_1; let e97: vec2 = vec2(e95, 6.0); let e102: vec4 = textureSampleBias(tex1D, samp, (e97.x / e97.y), 2.0); c = e102; - let e103: f32 = coord1; - let e109: f32 = coord1; + let e103: f32 = coord_1; + let e109: f32 = coord_1; let e113: vec4 = vec4(e109, 0.0, 0.0, 6.0); let e120: vec4 = textureSampleBias(tex1D, samp, (e113.xyz / vec3(e113.w)).x, 2.0); c = e120; - let e121: f32 = coord1; - let e126: f32 = coord1; + let e121: f32 = coord_1; + let e126: f32 = coord_1; let e128: vec2 = vec2(e126, 6.0); let e134: vec4 = textureSampleGrad(tex1D, samp, (e128.x / e128.y), 4.0, 4.0); c = e134; - let e135: f32 = coord1; - let e142: f32 = coord1; + let e135: f32 = coord_1; + let e142: f32 = coord_1; let e146: vec4 = vec4(e142, 0.0, 0.0, 6.0); let e154: vec4 = textureSampleGrad(tex1D, samp, (e146.xyz / vec3(e146.w)).x, 4.0, 4.0); c = e154; - let e155: f32 = coord1; - let e161: f32 = coord1; + let e155: f32 = coord_1; + let e161: f32 = coord_1; let e163: vec2 = vec2(e161, 6.0); let e170: vec4 = textureSampleGrad(tex1D, samp, (e163.x / e163.y), 4.0, 4.0, 5); c = e170; - let e171: f32 = coord1; - let e179: f32 = coord1; + let e171: f32 = coord_1; + let e179: f32 = coord_1; let e183: vec4 = vec4(e179, 0.0, 0.0, 6.0); let e192: vec4 = textureSampleGrad(tex1D, samp, (e183.xyz / vec3(e183.w)).x, 4.0, 4.0, 5); c = e192; - let e193: f32 = coord1; - let e197: f32 = coord1; + let e193: f32 = coord_1; + let e197: f32 = coord_1; let e199: vec2 = vec2(e197, 6.0); let e204: vec4 = textureSampleLevel(tex1D, samp, (e199.x / e199.y), 3.0); c = e204; - let e205: f32 = coord1; - let e211: f32 = coord1; + let e205: f32 = coord_1; + let e211: f32 = coord_1; let e215: vec4 = vec4(e211, 0.0, 0.0, 6.0); let e222: vec4 = textureSampleLevel(tex1D, samp, (e215.xyz / vec3(e215.w)).x, 3.0); c = e222; - let e223: f32 = coord1; - let e228: f32 = coord1; + let e223: f32 = coord_1; + let e228: f32 = coord_1; let e230: vec2 = vec2(e228, 6.0); let e236: vec4 = textureSampleLevel(tex1D, samp, (e230.x / e230.y), 3.0, 5); c = e236; - let e237: f32 = coord1; - let e244: f32 = coord1; + let e237: f32 = coord_1; + let e244: f32 = coord_1; let e248: vec4 = vec4(e244, 0.0, 0.0, 6.0); let e256: vec4 = textureSampleLevel(tex1D, samp, (e248.xyz / vec3(e248.w)).x, 3.0, 5); c = e256; - let e257: f32 = coord1; - let e261: f32 = coord1; + let e257: f32 = coord_1; + let e261: f32 = coord_1; let e263: vec2 = vec2(e261, 6.0); let e268: vec4 = textureSample(tex1D, samp, (e263.x / e263.y), 5); c = e268; - let e269: f32 = coord1; - let e275: f32 = coord1; + let e269: f32 = coord_1; + let e275: f32 = coord_1; let e279: vec4 = vec4(e275, 0.0, 0.0, 6.0); let e286: vec4 = textureSample(tex1D, samp, (e279.xyz / vec3(e279.w)).x, 5); c = e286; - let e287: f32 = coord1; - let e292: f32 = coord1; + let e287: f32 = coord_1; + let e292: f32 = coord_1; let e294: vec2 = vec2(e292, 6.0); let e300: vec4 = textureSampleBias(tex1D, samp, (e294.x / e294.y), 2.0, 5); c = e300; - let e301: f32 = coord1; - let e308: f32 = coord1; + let e301: f32 = coord_1; + let e308: f32 = coord_1; let e312: vec4 = vec4(e308, 0.0, 0.0, 6.0); let e320: vec4 = textureSampleBias(tex1D, samp, (e312.xyz / vec3(e312.w)).x, 2.0, 5); c = e320; return; } -fn testTex1DArray(coord2: vec2) { - var coord3: vec2; - var c1: vec4; +fn testTex1DArray(coord_2: vec2) { + var coord_3: vec2; + var c_1: vec4; - coord3 = coord2; - let e18: vec2 = coord3; + coord_3 = coord_2; + let e18: vec2 = coord_3; let e22: vec4 = textureSample(tex1DArray, samp, e18.x, i32(e18.y)); - c1 = e22; - let e25: vec2 = coord3; + c_1 = e22; + let e25: vec2 = coord_3; let e30: vec4 = textureSampleBias(tex1DArray, samp, e25.x, i32(e25.y), 2.0); - c1 = e30; - let e34: vec2 = coord3; + c_1 = e30; + let e34: vec2 = coord_3; let e40: vec4 = textureSampleGrad(tex1DArray, samp, e34.x, i32(e34.y), 4.0, 4.0); - c1 = e40; - let e45: vec2 = coord3; + c_1 = e40; + let e45: vec2 = coord_3; let e52: vec4 = textureSampleGrad(tex1DArray, samp, e45.x, i32(e45.y), 4.0, 4.0, 5); - c1 = e52; - let e55: vec2 = coord3; + c_1 = e52; + let e55: vec2 = coord_3; let e60: vec4 = textureSampleLevel(tex1DArray, samp, e55.x, i32(e55.y), 3.0); - c1 = e60; - let e64: vec2 = coord3; + c_1 = e60; + let e64: vec2 = coord_3; let e70: vec4 = textureSampleLevel(tex1DArray, samp, e64.x, i32(e64.y), 3.0, 5); - c1 = e70; - let e73: vec2 = coord3; + c_1 = e70; + let e73: vec2 = coord_3; let e78: vec4 = textureSample(tex1DArray, samp, e73.x, i32(e73.y), 5); - c1 = e78; - let e82: vec2 = coord3; + c_1 = e78; + let e82: vec2 = coord_3; let e88: vec4 = textureSampleBias(tex1DArray, samp, e82.x, i32(e82.y), 2.0, 5); - c1 = e88; + c_1 = e88; return; } -fn testTex2D(coord4: vec2) { - var coord5: vec2; - var c2: vec4; +fn testTex2D(coord_4: vec2) { + var coord_5: vec2; + var c_2: vec4; - coord5 = coord4; - let e18: vec2 = coord5; + coord_5 = coord_4; + let e18: vec2 = coord_5; let e19: vec4 = textureSample(tex2D, samp, e18); - c2 = e19; - let e22: vec2 = coord5; + c_2 = e19; + let e22: vec2 = coord_5; let e24: vec4 = textureSampleBias(tex2D, samp, e22, 2.0); - c2 = e24; - let e30: vec2 = coord5; + c_2 = e24; + let e30: vec2 = coord_5; let e35: vec4 = textureSampleGrad(tex2D, samp, e30, vec2(4.0), vec2(4.0)); - c2 = e35; - let e43: vec2 = coord5; + c_2 = e35; + let e43: vec2 = coord_5; let e50: vec4 = textureSampleGrad(tex2D, samp, e43, vec2(4.0), vec2(4.0), vec2(5, 5)); - c2 = e50; - let e53: vec2 = coord5; + c_2 = e50; + let e53: vec2 = coord_5; let e55: vec4 = textureSampleLevel(tex2D, samp, e53, 3.0); - c2 = e55; - let e60: vec2 = coord5; + c_2 = e55; + let e60: vec2 = coord_5; let e64: vec4 = textureSampleLevel(tex2D, samp, e60, 3.0, vec2(5, 5)); - c2 = e64; - let e68: vec2 = coord5; + c_2 = e64; + let e68: vec2 = coord_5; let e71: vec4 = textureSample(tex2D, samp, e68, vec2(5, 5)); - c2 = e71; - let e76: vec2 = coord5; + c_2 = e71; + let e76: vec2 = coord_5; let e80: vec4 = textureSampleBias(tex2D, samp, e76, 2.0, vec2(5, 5)); - c2 = e80; - let e81: vec2 = coord5; - let e84: vec2 = coord5; + c_2 = e80; + let e81: vec2 = coord_5; + let e84: vec2 = coord_5; let e86: vec3 = vec3(e84, 6.0); let e91: vec4 = textureSample(tex2D, samp, (e86.xy / vec2(e86.z))); - c2 = e91; - let e92: vec2 = coord5; - let e96: vec2 = coord5; + c_2 = e91; + let e92: vec2 = coord_5; + let e96: vec2 = coord_5; let e99: vec4 = vec4(e96, 0.0, 6.0); let e105: vec4 = textureSample(tex2D, samp, (e99.xyz / vec3(e99.w)).xy); - c2 = e105; - let e106: vec2 = coord5; - let e110: vec2 = coord5; + c_2 = e105; + let e106: vec2 = coord_5; + let e110: vec2 = coord_5; let e112: vec3 = vec3(e110, 6.0); let e118: vec4 = textureSampleBias(tex2D, samp, (e112.xy / vec2(e112.z)), 2.0); - c2 = e118; - let e119: vec2 = coord5; - let e124: vec2 = coord5; + c_2 = e118; + let e119: vec2 = coord_5; + let e124: vec2 = coord_5; let e127: vec4 = vec4(e124, 0.0, 6.0); let e134: vec4 = textureSampleBias(tex2D, samp, (e127.xyz / vec3(e127.w)).xy, 2.0); - c2 = e134; - let e135: vec2 = coord5; - let e142: vec2 = coord5; + c_2 = e134; + let e135: vec2 = coord_5; + let e142: vec2 = coord_5; let e144: vec3 = vec3(e142, 6.0); let e153: vec4 = textureSampleGrad(tex2D, samp, (e144.xy / vec2(e144.z)), vec2(4.0), vec2(4.0)); - c2 = e153; - let e154: vec2 = coord5; - let e162: vec2 = coord5; + c_2 = e153; + let e154: vec2 = coord_5; + let e162: vec2 = coord_5; let e165: vec4 = vec4(e162, 0.0, 6.0); let e175: vec4 = textureSampleGrad(tex2D, samp, (e165.xyz / vec3(e165.w)).xy, vec2(4.0), vec2(4.0)); - c2 = e175; - let e176: vec2 = coord5; - let e185: vec2 = coord5; + c_2 = e175; + let e176: vec2 = coord_5; + let e185: vec2 = coord_5; let e187: vec3 = vec3(e185, 6.0); let e198: vec4 = textureSampleGrad(tex2D, samp, (e187.xy / vec2(e187.z)), vec2(4.0), vec2(4.0), vec2(5, 5)); - c2 = e198; - let e199: vec2 = coord5; - let e209: vec2 = coord5; + c_2 = e198; + let e199: vec2 = coord_5; + let e209: vec2 = coord_5; let e212: vec4 = vec4(e209, 0.0, 6.0); let e224: vec4 = textureSampleGrad(tex2D, samp, (e212.xyz / vec3(e212.w)).xy, vec2(4.0), vec2(4.0), vec2(5, 5)); - c2 = e224; - let e225: vec2 = coord5; - let e229: vec2 = coord5; + c_2 = e224; + let e225: vec2 = coord_5; + let e229: vec2 = coord_5; let e231: vec3 = vec3(e229, 6.0); let e237: vec4 = textureSampleLevel(tex2D, samp, (e231.xy / vec2(e231.z)), 3.0); - c2 = e237; - let e238: vec2 = coord5; - let e243: vec2 = coord5; + c_2 = e237; + let e238: vec2 = coord_5; + let e243: vec2 = coord_5; let e246: vec4 = vec4(e243, 0.0, 6.0); let e253: vec4 = textureSampleLevel(tex2D, samp, (e246.xyz / vec3(e246.w)).xy, 3.0); - c2 = e253; - let e254: vec2 = coord5; - let e260: vec2 = coord5; + c_2 = e253; + let e254: vec2 = coord_5; + let e260: vec2 = coord_5; let e262: vec3 = vec3(e260, 6.0); let e270: vec4 = textureSampleLevel(tex2D, samp, (e262.xy / vec2(e262.z)), 3.0, vec2(5, 5)); - c2 = e270; - let e271: vec2 = coord5; - let e278: vec2 = coord5; + c_2 = e270; + let e271: vec2 = coord_5; + let e278: vec2 = coord_5; let e281: vec4 = vec4(e278, 0.0, 6.0); let e290: vec4 = textureSampleLevel(tex2D, samp, (e281.xyz / vec3(e281.w)).xy, 3.0, vec2(5, 5)); - c2 = e290; - let e291: vec2 = coord5; - let e296: vec2 = coord5; + c_2 = e290; + let e291: vec2 = coord_5; + let e296: vec2 = coord_5; let e298: vec3 = vec3(e296, 6.0); let e305: vec4 = textureSample(tex2D, samp, (e298.xy / vec2(e298.z)), vec2(5, 5)); - c2 = e305; - let e306: vec2 = coord5; - let e312: vec2 = coord5; + c_2 = e305; + let e306: vec2 = coord_5; + let e312: vec2 = coord_5; let e315: vec4 = vec4(e312, 0.0, 6.0); let e323: vec4 = textureSample(tex2D, samp, (e315.xyz / vec3(e315.w)).xy, vec2(5, 5)); - c2 = e323; - let e324: vec2 = coord5; - let e330: vec2 = coord5; + c_2 = e323; + let e324: vec2 = coord_5; + let e330: vec2 = coord_5; let e332: vec3 = vec3(e330, 6.0); let e340: vec4 = textureSampleBias(tex2D, samp, (e332.xy / vec2(e332.z)), 2.0, vec2(5, 5)); - c2 = e340; - let e341: vec2 = coord5; - let e348: vec2 = coord5; + c_2 = e340; + let e341: vec2 = coord_5; + let e348: vec2 = coord_5; let e351: vec4 = vec4(e348, 0.0, 6.0); let e360: vec4 = textureSampleBias(tex2D, samp, (e351.xyz / vec3(e351.w)).xy, 2.0, vec2(5, 5)); - c2 = e360; + c_2 = e360; return; } -fn testTex2DShadow(coord6: vec2) { - var coord7: vec2; +fn testTex2DShadow(coord_6: vec2) { + var coord_7: vec2; var d: f32; - coord7 = coord6; - let e17: vec2 = coord7; - let e20: vec2 = coord7; + coord_7 = coord_6; + let e17: vec2 = coord_7; + let e20: vec2 = coord_7; let e22: vec3 = vec3(e20, 1.0); let e25: f32 = textureSampleCompare(tex2DShadow, sampShadow, e22.xy, e22.z); d = e25; - let e26: vec2 = coord7; - let e33: vec2 = coord7; + let e26: vec2 = coord_7; + let e33: vec2 = coord_7; let e35: vec3 = vec3(e33, 1.0); let e42: f32 = textureSampleCompareLevel(tex2DShadow, sampShadow, e35.xy, e35.z); d = e42; - let e43: vec2 = coord7; - let e52: vec2 = coord7; + let e43: vec2 = coord_7; + let e52: vec2 = coord_7; let e54: vec3 = vec3(e52, 1.0); let e63: f32 = textureSampleCompareLevel(tex2DShadow, sampShadow, e54.xy, e54.z, vec2(5, 5)); d = e63; - let e64: vec2 = coord7; - let e68: vec2 = coord7; + let e64: vec2 = coord_7; + let e68: vec2 = coord_7; let e70: vec3 = vec3(e68, 1.0); let e74: f32 = textureSampleCompareLevel(tex2DShadow, sampShadow, e70.xy, e70.z); d = e74; - let e75: vec2 = coord7; - let e81: vec2 = coord7; + let e75: vec2 = coord_7; + let e81: vec2 = coord_7; let e83: vec3 = vec3(e81, 1.0); let e89: f32 = textureSampleCompareLevel(tex2DShadow, sampShadow, e83.xy, e83.z, vec2(5, 5)); d = e89; - let e90: vec2 = coord7; - let e95: vec2 = coord7; + let e90: vec2 = coord_7; + let e95: vec2 = coord_7; let e97: vec3 = vec3(e95, 1.0); let e102: f32 = textureSampleCompare(tex2DShadow, sampShadow, e97.xy, e97.z, vec2(5, 5)); d = e102; - let e103: vec2 = coord7; - let e107: vec2 = coord7; + let e103: vec2 = coord_7; + let e107: vec2 = coord_7; let e110: vec4 = vec4(e107, 1.0, 6.0); let e114: vec3 = (e110.xyz / vec3(e110.w)); let e117: f32 = textureSampleCompare(tex2DShadow, sampShadow, e114.xy, e114.z); d = e117; - let e118: vec2 = coord7; - let e126: vec2 = coord7; + let e118: vec2 = coord_7; + let e126: vec2 = coord_7; let e129: vec4 = vec4(e126, 1.0, 6.0); let e137: vec3 = (e129.xyz / vec3(e129.w)); let e140: f32 = textureSampleCompareLevel(tex2DShadow, sampShadow, e137.xy, e137.z); d = e140; - let e141: vec2 = coord7; - let e151: vec2 = coord7; + let e141: vec2 = coord_7; + let e151: vec2 = coord_7; let e154: vec4 = vec4(e151, 1.0, 6.0); let e164: vec3 = (e154.xyz / vec3(e154.w)); let e167: f32 = textureSampleCompareLevel(tex2DShadow, sampShadow, e164.xy, e164.z, vec2(5, 5)); d = e167; - let e168: vec2 = coord7; - let e173: vec2 = coord7; + let e168: vec2 = coord_7; + let e173: vec2 = coord_7; let e176: vec4 = vec4(e173, 1.0, 6.0); let e181: vec3 = (e176.xyz / vec3(e176.w)); let e184: f32 = textureSampleCompareLevel(tex2DShadow, sampShadow, e181.xy, e181.z); d = e184; - let e185: vec2 = coord7; - let e192: vec2 = coord7; + let e185: vec2 = coord_7; + let e192: vec2 = coord_7; let e195: vec4 = vec4(e192, 1.0, 6.0); let e202: vec3 = (e195.xyz / vec3(e195.w)); let e205: f32 = textureSampleCompareLevel(tex2DShadow, sampShadow, e202.xy, e202.z, vec2(5, 5)); d = e205; - let e206: vec2 = coord7; - let e212: vec2 = coord7; + let e206: vec2 = coord_7; + let e212: vec2 = coord_7; let e215: vec4 = vec4(e212, 1.0, 6.0); let e221: vec3 = (e215.xyz / vec3(e215.w)); let e224: f32 = textureSampleCompare(tex2DShadow, sampShadow, e221.xy, e221.z, vec2(5, 5)); @@ -358,217 +358,217 @@ fn testTex2DShadow(coord6: vec2) { return; } -fn testTex2DArray(coord8: vec3) { - var coord9: vec3; - var c3: vec4; +fn testTex2DArray(coord_8: vec3) { + var coord_9: vec3; + var c_3: vec4; - coord9 = coord8; - let e18: vec3 = coord9; + coord_9 = coord_8; + let e18: vec3 = coord_9; let e22: vec4 = textureSample(tex2DArray, samp, e18.xy, i32(e18.z)); - c3 = e22; - let e25: vec3 = coord9; + c_3 = e22; + let e25: vec3 = coord_9; let e30: vec4 = textureSampleBias(tex2DArray, samp, e25.xy, i32(e25.z), 2.0); - c3 = e30; - let e36: vec3 = coord9; + c_3 = e30; + let e36: vec3 = coord_9; let e44: vec4 = textureSampleGrad(tex2DArray, samp, e36.xy, i32(e36.z), vec2(4.0), vec2(4.0)); - c3 = e44; - let e52: vec3 = coord9; + c_3 = e44; + let e52: vec3 = coord_9; let e62: vec4 = textureSampleGrad(tex2DArray, samp, e52.xy, i32(e52.z), vec2(4.0), vec2(4.0), vec2(5, 5)); - c3 = e62; - let e65: vec3 = coord9; + c_3 = e62; + let e65: vec3 = coord_9; let e70: vec4 = textureSampleLevel(tex2DArray, samp, e65.xy, i32(e65.z), 3.0); - c3 = e70; - let e75: vec3 = coord9; + c_3 = e70; + let e75: vec3 = coord_9; let e82: vec4 = textureSampleLevel(tex2DArray, samp, e75.xy, i32(e75.z), 3.0, vec2(5, 5)); - c3 = e82; - let e86: vec3 = coord9; + c_3 = e82; + let e86: vec3 = coord_9; let e92: vec4 = textureSample(tex2DArray, samp, e86.xy, i32(e86.z), vec2(5, 5)); - c3 = e92; - let e97: vec3 = coord9; + c_3 = e92; + let e97: vec3 = coord_9; let e104: vec4 = textureSampleBias(tex2DArray, samp, e97.xy, i32(e97.z), 2.0, vec2(5, 5)); - c3 = e104; + c_3 = e104; return; } -fn testTex2DArrayShadow(coord10: vec3) { - var coord11: vec3; - var d1: f32; +fn testTex2DArrayShadow(coord_10: vec3) { + var coord_11: vec3; + var d_1: f32; - coord11 = coord10; - let e17: vec3 = coord11; - let e20: vec3 = coord11; + coord_11 = coord_10; + let e17: vec3 = coord_11; + let e20: vec3 = coord_11; let e22: vec4 = vec4(e20, 1.0); let e27: f32 = textureSampleCompare(tex2DArrayShadow, sampShadow, e22.xy, i32(e22.z), e22.w); - d1 = e27; - let e28: vec3 = coord11; - let e35: vec3 = coord11; + d_1 = e27; + let e28: vec3 = coord_11; + let e35: vec3 = coord_11; let e37: vec4 = vec4(e35, 1.0); let e46: f32 = textureSampleCompareLevel(tex2DArrayShadow, sampShadow, e37.xy, i32(e37.z), e37.w); - d1 = e46; - let e47: vec3 = coord11; - let e56: vec3 = coord11; + d_1 = e46; + let e47: vec3 = coord_11; + let e56: vec3 = coord_11; let e58: vec4 = vec4(e56, 1.0); let e69: f32 = textureSampleCompareLevel(tex2DArrayShadow, sampShadow, e58.xy, i32(e58.z), e58.w, vec2(5, 5)); - d1 = e69; - let e70: vec3 = coord11; - let e74: vec3 = coord11; + d_1 = e69; + let e70: vec3 = coord_11; + let e74: vec3 = coord_11; let e76: vec4 = vec4(e74, 1.0); let e82: f32 = textureSampleCompareLevel(tex2DArrayShadow, sampShadow, e76.xy, i32(e76.z), e76.w); - d1 = e82; - let e83: vec3 = coord11; - let e89: vec3 = coord11; + d_1 = e82; + let e83: vec3 = coord_11; + let e89: vec3 = coord_11; let e91: vec4 = vec4(e89, 1.0); let e99: f32 = textureSampleCompareLevel(tex2DArrayShadow, sampShadow, e91.xy, i32(e91.z), e91.w, vec2(5, 5)); - d1 = e99; - let e100: vec3 = coord11; - let e105: vec3 = coord11; + d_1 = e99; + let e100: vec3 = coord_11; + let e105: vec3 = coord_11; let e107: vec4 = vec4(e105, 1.0); let e114: f32 = textureSampleCompare(tex2DArrayShadow, sampShadow, e107.xy, i32(e107.z), e107.w, vec2(5, 5)); - d1 = e114; + d_1 = e114; return; } -fn testTexCube(coord12: vec3) { - var coord13: vec3; - var c4: vec4; +fn testTexCube(coord_12: vec3) { + var coord_13: vec3; + var c_4: vec4; - coord13 = coord12; - let e18: vec3 = coord13; + coord_13 = coord_12; + let e18: vec3 = coord_13; let e19: vec4 = textureSample(texCube, samp, e18); - c4 = e19; - let e22: vec3 = coord13; + c_4 = e19; + let e22: vec3 = coord_13; let e24: vec4 = textureSampleBias(texCube, samp, e22, 2.0); - c4 = e24; - let e30: vec3 = coord13; + c_4 = e24; + let e30: vec3 = coord_13; let e35: vec4 = textureSampleGrad(texCube, samp, e30, vec3(4.0), vec3(4.0)); - c4 = e35; - let e38: vec3 = coord13; + c_4 = e35; + let e38: vec3 = coord_13; let e40: vec4 = textureSampleLevel(texCube, samp, e38, 3.0); - c4 = e40; - let e45: vec3 = coord13; + c_4 = e40; + let e45: vec3 = coord_13; let e49: vec4 = textureSampleLevel(texCube, samp, e45, 3.0, vec3(5, 5, 5)); - c4 = e49; - let e53: vec3 = coord13; + c_4 = e49; + let e53: vec3 = coord_13; let e56: vec4 = textureSample(texCube, samp, e53, vec3(5, 5, 5)); - c4 = e56; - let e61: vec3 = coord13; + c_4 = e56; + let e61: vec3 = coord_13; let e65: vec4 = textureSampleBias(texCube, samp, e61, 2.0, vec3(5, 5, 5)); - c4 = e65; + c_4 = e65; return; } -fn testTexCubeShadow(coord14: vec3) { - var coord15: vec3; - var d2: f32; +fn testTexCubeShadow(coord_14: vec3) { + var coord_15: vec3; + var d_2: f32; - coord15 = coord14; - let e17: vec3 = coord15; - let e20: vec3 = coord15; + coord_15 = coord_14; + let e17: vec3 = coord_15; + let e20: vec3 = coord_15; let e22: vec4 = vec4(e20, 1.0); let e25: f32 = textureSampleCompare(texCubeShadow, sampShadow, e22.xyz, e22.w); - d2 = e25; - let e26: vec3 = coord15; - let e33: vec3 = coord15; + d_2 = e25; + let e26: vec3 = coord_15; + let e33: vec3 = coord_15; let e35: vec4 = vec4(e33, 1.0); let e42: f32 = textureSampleCompareLevel(texCubeShadow, sampShadow, e35.xyz, e35.w); - d2 = e42; - let e43: vec3 = coord15; - let e47: vec3 = coord15; + d_2 = e42; + let e43: vec3 = coord_15; + let e47: vec3 = coord_15; let e49: vec4 = vec4(e47, 1.0); let e53: f32 = textureSampleCompareLevel(texCubeShadow, sampShadow, e49.xyz, e49.w); - d2 = e53; - let e54: vec3 = coord15; - let e60: vec3 = coord15; + d_2 = e53; + let e54: vec3 = coord_15; + let e60: vec3 = coord_15; let e62: vec4 = vec4(e60, 1.0); let e68: f32 = textureSampleCompareLevel(texCubeShadow, sampShadow, e62.xyz, e62.w, vec3(5, 5, 5)); - d2 = e68; - let e69: vec3 = coord15; - let e74: vec3 = coord15; + d_2 = e68; + let e69: vec3 = coord_15; + let e74: vec3 = coord_15; let e76: vec4 = vec4(e74, 1.0); let e81: f32 = textureSampleCompare(texCubeShadow, sampShadow, e76.xyz, e76.w, vec3(5, 5, 5)); - d2 = e81; + d_2 = e81; return; } -fn testTexCubeArray(coord16: vec4) { - var coord17: vec4; - var c5: vec4; +fn testTexCubeArray(coord_16: vec4) { + var coord_17: vec4; + var c_5: vec4; - coord17 = coord16; - let e18: vec4 = coord17; + coord_17 = coord_16; + let e18: vec4 = coord_17; let e22: vec4 = textureSample(texCubeArray, samp, e18.xyz, i32(e18.w)); - c5 = e22; - let e25: vec4 = coord17; + c_5 = e22; + let e25: vec4 = coord_17; let e30: vec4 = textureSampleBias(texCubeArray, samp, e25.xyz, i32(e25.w), 2.0); - c5 = e30; - let e36: vec4 = coord17; + c_5 = e30; + let e36: vec4 = coord_17; let e44: vec4 = textureSampleGrad(texCubeArray, samp, e36.xyz, i32(e36.w), vec3(4.0), vec3(4.0)); - c5 = e44; - let e47: vec4 = coord17; + c_5 = e44; + let e47: vec4 = coord_17; let e52: vec4 = textureSampleLevel(texCubeArray, samp, e47.xyz, i32(e47.w), 3.0); - c5 = e52; - let e57: vec4 = coord17; + c_5 = e52; + let e57: vec4 = coord_17; let e64: vec4 = textureSampleLevel(texCubeArray, samp, e57.xyz, i32(e57.w), 3.0, vec3(5, 5, 5)); - c5 = e64; - let e68: vec4 = coord17; + c_5 = e64; + let e68: vec4 = coord_17; let e74: vec4 = textureSample(texCubeArray, samp, e68.xyz, i32(e68.w), vec3(5, 5, 5)); - c5 = e74; - let e79: vec4 = coord17; + c_5 = e74; + let e79: vec4 = coord_17; let e86: vec4 = textureSampleBias(texCubeArray, samp, e79.xyz, i32(e79.w), 2.0, vec3(5, 5, 5)); - c5 = e86; + c_5 = e86; return; } -fn testTexCubeArrayShadow(coord18: vec4) { - var coord19: vec4; - var d3: f32; +fn testTexCubeArrayShadow(coord_18: vec4) { + var coord_19: vec4; + var d_3: f32; - coord19 = coord18; - let e19: vec4 = coord19; + coord_19 = coord_18; + let e19: vec4 = coord_19; let e24: f32 = textureSampleCompare(texCubeArrayShadow, sampShadow, e19.xyz, i32(e19.w), 1.0); - d3 = e24; + d_3 = e24; return; } -fn testTex3D(coord20: vec3) { - var coord21: vec3; - var c6: vec4; +fn testTex3D(coord_20: vec3) { + var coord_21: vec3; + var c_6: vec4; - coord21 = coord20; - let e18: vec3 = coord21; + coord_21 = coord_20; + let e18: vec3 = coord_21; let e19: vec4 = textureSample(tex3D, samp, e18); - c6 = e19; - let e22: vec3 = coord21; + c_6 = e19; + let e22: vec3 = coord_21; let e24: vec4 = textureSampleBias(tex3D, samp, e22, 2.0); - c6 = e24; - let e30: vec3 = coord21; + c_6 = e24; + let e30: vec3 = coord_21; let e35: vec4 = textureSampleGrad(tex3D, samp, e30, vec3(4.0), vec3(4.0)); - c6 = e35; - let e43: vec3 = coord21; + c_6 = e35; + let e43: vec3 = coord_21; let e50: vec4 = textureSampleGrad(tex3D, samp, e43, vec3(4.0), vec3(4.0), vec3(5, 5, 5)); - c6 = e50; - let e53: vec3 = coord21; + c_6 = e50; + let e53: vec3 = coord_21; let e55: vec4 = textureSampleLevel(tex3D, samp, e53, 3.0); - c6 = e55; - let e60: vec3 = coord21; + c_6 = e55; + let e60: vec3 = coord_21; let e64: vec4 = textureSampleLevel(tex3D, samp, e60, 3.0, vec3(5, 5, 5)); - c6 = e64; - let e68: vec3 = coord21; + c_6 = e64; + let e68: vec3 = coord_21; let e71: vec4 = textureSample(tex3D, samp, e68, vec3(5, 5, 5)); - c6 = e71; - let e76: vec3 = coord21; + c_6 = e71; + let e76: vec3 = coord_21; let e80: vec4 = textureSampleBias(tex3D, samp, e76, 2.0, vec3(5, 5, 5)); - c6 = e80; + c_6 = e80; return; } -fn main1() { +fn main_1() { return; } [[stage(fragment)]] fn main([[location(0)]] texcoord: vec4) { - texcoord1 = texcoord; - main1(); + texcoord_1 = texcoord; + main_1(); return; } diff --git a/tests/out/wgsl/swizzle_write-frag.wgsl b/tests/out/wgsl/swizzle_write-frag.wgsl index 1e56f90a5a..ece4610395 100644 --- a/tests/out/wgsl/swizzle_write-frag.wgsl +++ b/tests/out/wgsl/swizzle_write-frag.wgsl @@ -1,4 +1,4 @@ -fn main1() { +fn main_1() { var x: vec3 = vec3(2.0, 2.0, 2.0); let e3: vec3 = x; @@ -15,6 +15,6 @@ fn main1() { [[stage(fragment)]] fn main() { - main1(); + main_1(); return; }