From 7fff667c5af573bbe30ac3ed407a7e06508b3b01 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Sun, 24 Nov 2024 09:12:59 -0800 Subject: [PATCH] [glsl-in] Don't reinterpret function arguments twice in the normal case We already lowered the function expression if it's a normal in argument; no need to do it again. This eliminates an unused variable and expression. With chained function calls, this could lead to a lot of waste. There's still an extra unused expression in the case of an out/inout argument; ideally we'd remove these expressions, but it might be tricky. Fixes #6602 --- CHANGELOG.md | 1 + naga/src/front/glsl/ast.rs | 10 +- naga/src/front/glsl/functions.rs | 8 +- naga/tests/out/wgsl/246-collatz.comp.wgsl | 29 +- naga/tests/out/wgsl/bevy-pbr.frag.wgsl | 836 +++++++--------- naga/tests/out/wgsl/bits_glsl.frag.wgsl | 182 ++-- naga/tests/out/wgsl/bool-select.frag.wgsl | 18 +- naga/tests/out/wgsl/clamp-splat.vert.wgsl | 6 +- .../out/wgsl/double-math-functions.frag.wgsl | 101 +- naga/tests/out/wgsl/images.frag.wgsl | 58 +- .../tests/out/wgsl/inverse-polyfill.frag.wgsl | 12 +- naga/tests/out/wgsl/math-functions.frag.wgsl | 171 ++-- .../out/wgsl/sampler-functions.frag.wgsl | 16 +- naga/tests/out/wgsl/samplers.frag.wgsl | 946 ++++++++---------- .../tests/out/wgsl/vector-functions.frag.wgsl | 134 +-- 15 files changed, 1184 insertions(+), 1344 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0da41d018..0a54d21dbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -112,6 +112,7 @@ By @ErichDonGubler in [#6456](https://github.com/gfx-rs/wgpu/pull/6456), [#6148] #### Naga - Show types of LHS and RHS in binary operation type mismatch errors. By @ErichDonGubler in [#6450](https://github.com/gfx-rs/wgpu/pull/6450). +- The GLSL parser now uses less expressions for function calls. By @magcius in [#6604](https://github.com/gfx-rs/wgpu/pull/6604). #### General diff --git a/naga/src/front/glsl/ast.rs b/naga/src/front/glsl/ast.rs index ea0bce8661..78f5e2cb09 100644 --- a/naga/src/front/glsl/ast.rs +++ b/naga/src/front/glsl/ast.rs @@ -1,6 +1,6 @@ use std::{borrow::Cow, fmt}; -use super::{builtins::MacroCall, context::ExprPos, Span}; +use super::{builtins::MacroCall, Span}; use crate::{ AddressSpace, BinaryOperator, Binding, Constant, Expression, Function, GlobalVariable, Handle, Interpolation, Literal, Sampling, StorageAccess, Type, UnaryOperator, @@ -376,14 +376,6 @@ impl ParameterQualifier { _ => false, } } - - /// Converts from a parameter qualifier into a [`ExprPos`] - pub const fn as_pos(&self) -> ExprPos { - match *self { - ParameterQualifier::Out | ParameterQualifier::InOut => ExprPos::Lhs, - _ => ExprPos::Rhs, - } - } } /// The GLSL profile used by a shader. diff --git a/naga/src/front/glsl/functions.rs b/naga/src/front/glsl/functions.rs index 6805d6f039..658632e872 100644 --- a/naga/src/front/glsl/functions.rs +++ b/naga/src/front/glsl/functions.rs @@ -785,10 +785,10 @@ impl Frontend { .zip(raw_args) .zip(¶meters) { - let (mut handle, meta) = - ctx.lower_expect_inner(stmt, self, *expr, parameter_info.qualifier.as_pos())?; - if parameter_info.qualifier.is_lhs() { + // Reprocess argument in LHS position + let (handle, meta) = ctx.lower_expect_inner(stmt, self, *expr, ExprPos::Lhs)?; + self.process_lhs_argument( ctx, meta, @@ -803,6 +803,8 @@ impl Frontend { continue; } + let (mut handle, meta) = *call_argument; + let scalar_comps = scalar_components(&ctx.module.types[*parameter].inner); // Apply implicit conversions as needed diff --git a/naga/tests/out/wgsl/246-collatz.comp.wgsl b/naga/tests/out/wgsl/246-collatz.comp.wgsl index 916bb4ae4d..71453bfe1c 100644 --- a/naga/tests/out/wgsl/246-collatz.comp.wgsl +++ b/naga/tests/out/wgsl/246-collatz.comp.wgsl @@ -17,25 +17,25 @@ fn collatz_iterations(n: u32) -> u32 { break; } { - let _e14 = n_1; - let _e15 = f32(_e14); - if ((_e15 - (floor((_e15 / 2f)) * 2f)) == 0f) { + let _e12 = n_1; + let _e14 = f32(_e12); + if ((_e14 - (floor((_e14 / 2f)) * 2f)) == 0f) { { - let _e25 = n_1; - n_1 = (_e25 / 2u); + let _e23 = n_1; + n_1 = (_e23 / 2u); } } else { { - let _e30 = n_1; - n_1 = ((3u * _e30) + 1u); + let _e28 = n_1; + n_1 = ((3u * _e28) + 1u); } } - let _e36 = i; - i = (_e36 + 1u); + let _e34 = i; + i = (_e34 + 1u); } } - let _e39 = i; - return _e39; + let _e37 = i; + return _e37; } fn main_1() { @@ -45,10 +45,9 @@ fn main_1() { index = _e3.x; let _e6 = index; let _e8 = index; - let _e11 = index; - let _e13 = global.indices[_e11]; - let _e14 = collatz_iterations(_e13); - global.indices[_e6] = _e14; + let _e10 = global.indices[_e8]; + let _e11 = collatz_iterations(_e10); + global.indices[_e6] = _e11; return; } diff --git a/naga/tests/out/wgsl/bevy-pbr.frag.wgsl b/naga/tests/out/wgsl/bevy-pbr.frag.wgsl index 012077791e..78d3fbe606 100644 --- a/naga/tests/out/wgsl/bevy-pbr.frag.wgsl +++ b/naga/tests/out/wgsl/bevy-pbr.frag.wgsl @@ -123,15 +123,13 @@ fn getDistanceAttenuation(distanceSquare: f32, inverseRangeSquared: f32) -> f32 factor = (_e44 * _e45); let _e49 = factor; let _e50 = factor; - let _e56 = factor; - let _e57 = factor; - smoothFactor = clamp((1f - (_e56 * _e57)), 0f, 1f); - let _e64 = smoothFactor; - let _e65 = smoothFactor; - attenuation = (_e64 * _e65); - let _e68 = attenuation; - let _e73 = distanceSquare_1; - return ((_e68 * 1f) / max(_e73, 0.001f)); + smoothFactor = clamp((1f - (_e49 * _e50)), 0f, 1f); + let _e57 = smoothFactor; + let _e58 = smoothFactor; + attenuation = (_e57 * _e58); + let _e61 = attenuation; + let _e64 = distanceSquare_1; + return ((_e61 * 1f) / max(_e64, 0.001f)); } fn D_GGX(roughness: f32, NoH: f32, h: vec3) -> f32 { @@ -183,29 +181,19 @@ fn V_SmithGGXCorrelated(roughness_2: f32, NoV: f32, NoL: f32) -> f32 { let _e53 = NoV_1; let _e56 = NoV_1; let _e58 = a2_; - let _e60 = NoV_1; - let _e61 = a2_; - let _e62 = NoV_1; - let _e65 = NoV_1; - let _e67 = a2_; - lambdaV = (_e50 * sqrt((((_e60 - (_e61 * _e62)) * _e65) + _e67))); - let _e72 = NoV_1; - let _e73 = NoL_1; - let _e74 = a2_; - let _e75 = NoL_1; - let _e78 = NoL_1; - let _e80 = a2_; - let _e82 = NoL_1; - let _e83 = a2_; - let _e84 = NoL_1; - let _e87 = NoL_1; - let _e89 = a2_; - lambdaL = (_e72 * sqrt((((_e82 - (_e83 * _e84)) * _e87) + _e89))); - let _e95 = lambdaV; - let _e96 = lambdaL; - v = (0.5f / (_e95 + _e96)); - let _e100 = v; - return _e100; + lambdaV = (_e50 * sqrt((((_e51 - (_e52 * _e53)) * _e56) + _e58))); + let _e63 = NoV_1; + let _e64 = NoL_1; + let _e65 = a2_; + let _e66 = NoL_1; + let _e69 = NoL_1; + let _e71 = a2_; + lambdaL = (_e63 * sqrt((((_e64 - (_e65 * _e66)) * _e69) + _e71))); + let _e77 = lambdaV; + let _e78 = lambdaL; + v = (0.5f / (_e77 + _e78)); + let _e82 = v; + return _e82; } fn F_Schlick(f0_: vec3, f90_: f32, VoH: f32) -> vec3 { @@ -216,9 +204,8 @@ fn F_Schlick(f0_: vec3, f90_: f32, VoH: f32) -> vec3 { VoH_1 = VoH; let _e45 = f90_1; let _e49 = VoH_1; - let _e52 = VoH_1; - let _e54 = pow5_((1f - _e52)); - return (f0_ + ((vec3(_e45) - f0_) * _e54)); + let _e51 = pow5_((1f - _e49)); + return (f0_ + ((vec3(_e45) - f0_) * _e51)); } fn F_Schlick_1(f0_1: f32, f90_2: f32, VoH_2: f32) -> f32 { @@ -233,9 +220,8 @@ fn F_Schlick_1(f0_1: f32, f90_2: f32, VoH_2: f32) -> f32 { let _e47 = f90_3; let _e48 = f0_2; let _e51 = VoH_3; - let _e54 = VoH_3; - let _e56 = pow5_((1f - _e54)); - return (_e46 + ((_e47 - _e48) * _e56)); + let _e53 = pow5_((1f - _e51)); + return (_e46 + ((_e47 - _e48) * _e53)); } fn fresnel(f0_3: vec3, LoH: f32) -> vec3 { @@ -245,14 +231,13 @@ fn fresnel(f0_3: vec3, LoH: f32) -> vec3 { f0_4 = f0_3; LoH_1 = LoH; - let _e49 = f0_4; - let _e62 = f0_4; - f90_4 = clamp(dot(_e62, vec3(16.5f)), 0f, 1f); - let _e75 = f0_4; - let _e76 = f90_4; - let _e77 = LoH_1; - let _e78 = F_Schlick(_e75, _e76, _e77); - return _e78; + let _e44 = f0_4; + f90_4 = clamp(dot(_e44, vec3(16.5f)), 0f, 1f); + let _e54 = f0_4; + let _e55 = f90_4; + let _e56 = LoH_1; + let _e57 = F_Schlick(_e54, _e55, _e56); + return _e57; } 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 { @@ -274,24 +259,24 @@ fn specular(f0_5: vec3, roughness_4: f32, h_1: vec3, NoV_2: f32, NoL_2 NoH_3 = NoH_2; LoH_3 = LoH_2; specularIntensity_1 = specularIntensity; - let _e57 = roughness_5; - let _e58 = NoH_3; - let _e59 = D_GGX(_e57, _e58, h_1); - D = _e59; - let _e64 = roughness_5; - let _e65 = NoV_3; - let _e66 = NoL_3; - let _e67 = V_SmithGGXCorrelated(_e64, _e65, _e66); - V = _e67; - let _e71 = f0_6; - let _e72 = LoH_3; - let _e73 = fresnel(_e71, _e72); - F = _e73; - let _e75 = specularIntensity_1; - let _e76 = D; - let _e78 = V; - let _e80 = F; - return (((_e75 * _e76) * _e78) * _e80); + let _e55 = roughness_5; + let _e56 = NoH_3; + let _e57 = D_GGX(_e55, _e56, h_1); + D = _e57; + let _e59 = roughness_5; + let _e60 = NoV_3; + let _e61 = NoL_3; + let _e62 = V_SmithGGXCorrelated(_e59, _e60, _e61); + V = _e62; + let _e64 = f0_6; + let _e65 = LoH_3; + let _e66 = fresnel(_e64, _e65); + F = _e66; + let _e68 = specularIntensity_1; + let _e69 = D; + let _e71 = V; + let _e73 = F; + return (((_e68 * _e69) * _e71) * _e73); } fn Fd_Burley(roughness_6: f32, NoV_4: f32, NoL_4: f32, LoH_4: f32) -> f32 { @@ -311,17 +296,17 @@ fn Fd_Burley(roughness_6: f32, NoV_4: f32, NoL_4: f32, LoH_4: f32) -> f32 { let _e52 = LoH_5; let _e54 = LoH_5; f90_5 = (0.5f + (((2f * _e50) * _e52) * _e54)); - let _e62 = f90_5; - let _e63 = NoL_5; - let _e64 = F_Schlick_1(1f, _e62, _e63); - lightScatter = _e64; - let _e70 = f90_5; - let _e71 = NoV_5; - let _e72 = F_Schlick_1(1f, _e70, _e71); - viewScatter = _e72; - let _e74 = lightScatter; - let _e75 = viewScatter; - return ((_e74 * _e75) * 0.31830987f); + let _e59 = f90_5; + let _e60 = NoL_5; + let _e61 = F_Schlick_1(1f, _e59, _e60); + lightScatter = _e61; + let _e64 = f90_5; + let _e65 = NoV_5; + let _e66 = F_Schlick_1(1f, _e64, _e65); + viewScatter = _e66; + let _e68 = lightScatter; + let _e69 = viewScatter; + return ((_e68 * _e69) * 0.31830987f); } fn EnvBRDFApprox(f0_7: vec3, perceptual_roughness: f32, NoV_6: f32) -> vec3 { @@ -344,21 +329,16 @@ fn EnvBRDFApprox(f0_7: vec3, perceptual_roughness: f32, NoV_6: f32) -> vec3 let _e69 = r; let _e71 = r; let _e76 = NoV_7; - let _e80 = NoV_7; + let _e80 = r; let _e83 = r; - let _e85 = r; - let _e90 = NoV_7; - let _e94 = NoV_7; - let _e98 = r; - let _e101 = r; - a004_ = ((min((_e83.x * _e85.x), exp2((-9.28f * _e94))) * _e98.x) + _e101.y); - let _e109 = a004_; - let _e112 = r; - AB = ((vec2(-1.04f, 1.04f) * vec2(_e109)) + _e112.zw); - let _e116 = f0_8; - let _e117 = AB; - let _e121 = AB; - return ((_e116 * vec3(_e117.x)) + vec3(_e121.y)); + a004_ = ((min((_e69.x * _e71.x), exp2((-9.28f * _e76))) * _e80.x) + _e83.y); + let _e91 = a004_; + let _e94 = r; + AB = ((vec2(-1.04f, 1.04f) * vec2(_e91)) + _e94.zw); + let _e98 = f0_8; + let _e99 = AB; + let _e103 = AB; + return ((_e98 * vec3(_e99.x)) + vec3(_e103.y)); } fn perceptualRoughnessToRoughness(perceptualRoughness: f32) -> f32 { @@ -366,11 +346,11 @@ fn perceptualRoughnessToRoughness(perceptualRoughness: f32) -> f32 { var clampedPerceptualRoughness: f32; perceptualRoughness_1 = perceptualRoughness; - let _e45 = perceptualRoughness_1; - clampedPerceptualRoughness = clamp(_e45, 0.089f, 1f); - let _e50 = clampedPerceptualRoughness; - let _e51 = clampedPerceptualRoughness; - return (_e50 * _e51); + let _e42 = perceptualRoughness_1; + clampedPerceptualRoughness = clamp(_e42, 0.089f, 1f); + let _e47 = clampedPerceptualRoughness; + let _e48 = clampedPerceptualRoughness; + return (_e47 * _e48); } fn reinhard(color: vec3) -> vec3 { @@ -403,8 +383,8 @@ fn luminance(v_1: vec3) -> f32 { var v_2: vec3; v_2 = v_1; - let _e47 = v_2; - return dot(_e47, vec3(0.2126f, 0.7152f, 0.0722f)); + let _e42 = v_2; + return dot(_e42, vec3(0.2126f, 0.7152f, 0.0722f)); } fn change_luminance(c_in: vec3, l_out: f32) -> vec3 { @@ -414,13 +394,13 @@ fn change_luminance(c_in: vec3, l_out: f32) -> vec3 { c_in_1 = c_in; l_out_1 = l_out; - let _e45 = c_in_1; - let _e46 = luminance(_e45); - l_in = _e46; - let _e48 = c_in_1; - let _e49 = l_out_1; - let _e50 = l_in; - return (_e48 * (_e49 / _e50)); + let _e44 = c_in_1; + let _e45 = luminance(_e44); + l_in = _e45; + let _e47 = c_in_1; + let _e48 = l_out_1; + let _e49 = l_in; + return (_e47 * (_e48 / _e49)); } fn reinhard_luminance(color_4: vec3) -> vec3 { @@ -429,16 +409,16 @@ fn reinhard_luminance(color_4: vec3) -> vec3 { var l_new: f32; color_5 = color_4; - let _e43 = color_5; - let _e44 = luminance(_e43); - l_old = _e44; - let _e46 = l_old; - let _e48 = l_old; - l_new = (_e46 / (1f + _e48)); - let _e54 = color_5; - let _e55 = l_new; - let _e56 = change_luminance(_e54, _e55); - return _e56; + let _e42 = color_5; + let _e43 = luminance(_e42); + l_old = _e43; + let _e45 = l_old; + let _e47 = l_old; + l_new = (_e45 / (1f + _e47)); + let _e51 = color_5; + let _e52 = l_new; + let _e53 = change_luminance(_e51, _e52); + return _e53; } fn reinhard_extended_luminance(color_6: vec3, max_white_l: f32) -> vec3 { @@ -450,21 +430,21 @@ fn reinhard_extended_luminance(color_6: vec3, max_white_l: f32) -> vec3, V_1: vec3, R: vec3, F0_: vec3, diffuseColor: vec3) -> vec3 { @@ -505,120 +485,91 @@ fn point_light(light: PointLight, roughness_8: f32, NdotV: f32, N: vec3, V_ let _e56 = light_1; let _e59 = v_WorldPosition_1; light_to_frag = (_e56.pos.xyz - _e59.xyz); - let _e65 = light_to_frag; - let _e66 = light_to_frag; - distance_square = dot(_e65, _e66); - let _e70 = light_1; - let _e73 = distance_square; - let _e74 = light_1; - let _e77 = getDistanceAttenuation(_e73, _e74.lightParams.x); - rangeAttenuation = _e77; - let _e79 = roughness_9; - a_1 = _e79; - let _e81 = light_1; - radius = _e81.lightParams.y; + let _e63 = light_to_frag; + let _e64 = light_to_frag; + distance_square = dot(_e63, _e64); + let _e67 = distance_square; + let _e68 = light_1; + let _e71 = getDistanceAttenuation(_e67, _e68.lightParams.x); + rangeAttenuation = _e71; + let _e73 = roughness_9; + a_1 = _e73; + let _e75 = light_1; + radius = _e75.lightParams.y; + let _e79 = light_to_frag; + let _e80 = R_1; + let _e82 = R_1; + let _e84 = light_to_frag; + centerToRay = ((dot(_e79, _e80) * _e82) - _e84); let _e87 = light_to_frag; - let _e88 = R_1; - let _e90 = R_1; - let _e92 = light_to_frag; - centerToRay = ((dot(_e87, _e88) * _e90) - _e92); - let _e95 = light_to_frag; - let _e96 = centerToRay; - let _e97 = radius; - let _e100 = centerToRay; - let _e101 = centerToRay; - let _e105 = centerToRay; - let _e106 = centerToRay; - let _e112 = radius; - let _e115 = centerToRay; - let _e116 = centerToRay; - let _e120 = centerToRay; - let _e121 = centerToRay; - closestPoint = (_e95 + (_e96 * clamp((_e112 * inverseSqrt(dot(_e120, _e121))), 0f, 1f))); - let _e133 = closestPoint; - let _e134 = closestPoint; - let _e138 = closestPoint; - let _e139 = closestPoint; - LspecLengthInverse = inverseSqrt(dot(_e138, _e139)); - let _e143 = a_1; - let _e144 = a_1; - let _e145 = radius; - let _e148 = LspecLengthInverse; - let _e153 = a_1; - let _e154 = radius; - let _e157 = LspecLengthInverse; - normalizationFactor = (_e143 / clamp((_e153 + ((_e154 * 0.5f) * _e157)), 0f, 1f)); - let _e165 = normalizationFactor; - let _e166 = normalizationFactor; - specularIntensity_2 = (_e165 * _e166); - let _e169 = closestPoint; - let _e170 = LspecLengthInverse; - L = (_e169 * _e170); - let _e173 = L; - let _e174 = V_2; - let _e176 = L; - let _e177 = V_2; - H = normalize((_e176 + _e177)); - let _e183 = N_1; - let _e184 = L; - let _e190 = N_1; - let _e191 = L; - NoL_6 = clamp(dot(_e190, _e191), 0f, 1f); - let _e199 = N_1; - let _e200 = H; - let _e206 = N_1; - let _e207 = H; - NoH_4 = clamp(dot(_e206, _e207), 0f, 1f); - let _e215 = L; - let _e216 = H; - let _e222 = L; - let _e223 = H; - LoH_6 = clamp(dot(_e222, _e223), 0f, 1f); - let _e237 = F0_1; - let _e238 = roughness_9; - let _e239 = H; - let _e240 = NdotV_1; - let _e241 = NoL_6; - let _e242 = NoH_4; - let _e243 = LoH_6; - let _e244 = specularIntensity_2; - let _e245 = specular(_e237, _e238, _e239, _e240, _e241, _e242, _e243, _e244); - specular_1 = _e245; - let _e248 = light_to_frag; - L = normalize(_e248); - let _e250 = L; - let _e251 = V_2; - let _e253 = L; - let _e254 = V_2; - H = normalize((_e253 + _e254)); - let _e259 = N_1; - let _e260 = L; - let _e266 = N_1; - let _e267 = L; - NoL_6 = clamp(dot(_e266, _e267), 0f, 1f); - let _e274 = N_1; - let _e275 = H; - let _e281 = N_1; - let _e282 = H; - NoH_4 = clamp(dot(_e281, _e282), 0f, 1f); - let _e289 = L; - let _e290 = H; - let _e296 = L; - let _e297 = H; - LoH_6 = clamp(dot(_e296, _e297), 0f, 1f); - let _e302 = diffuseColor_1; - let _e307 = roughness_9; - let _e308 = NdotV_1; - let _e309 = NoL_6; - let _e310 = LoH_6; - let _e311 = Fd_Burley(_e307, _e308, _e309, _e310); - diffuse = (_e302 * _e311); - let _e314 = diffuse; - let _e315 = specular_1; - let _e317 = light_1; - let _e321 = rangeAttenuation; - let _e322 = NoL_6; - return (((_e314 + _e315) * _e317.color.xyz) * (_e321 * _e322)); + let _e88 = centerToRay; + let _e89 = radius; + let _e90 = centerToRay; + let _e91 = centerToRay; + closestPoint = (_e87 + (_e88 * clamp((_e89 * inverseSqrt(dot(_e90, _e91))), 0f, 1f))); + let _e101 = closestPoint; + let _e102 = closestPoint; + LspecLengthInverse = inverseSqrt(dot(_e101, _e102)); + let _e106 = a_1; + let _e107 = a_1; + let _e108 = radius; + let _e111 = LspecLengthInverse; + normalizationFactor = (_e106 / clamp((_e107 + ((_e108 * 0.5f) * _e111)), 0f, 1f)); + let _e119 = normalizationFactor; + let _e120 = normalizationFactor; + specularIntensity_2 = (_e119 * _e120); + let _e123 = closestPoint; + let _e124 = LspecLengthInverse; + L = (_e123 * _e124); + let _e127 = L; + let _e128 = V_2; + H = normalize((_e127 + _e128)); + let _e132 = N_1; + let _e133 = L; + NoL_6 = clamp(dot(_e132, _e133), 0f, 1f); + let _e139 = N_1; + let _e140 = H; + NoH_4 = clamp(dot(_e139, _e140), 0f, 1f); + let _e146 = L; + let _e147 = H; + LoH_6 = clamp(dot(_e146, _e147), 0f, 1f); + let _e153 = F0_1; + let _e154 = roughness_9; + let _e155 = H; + let _e156 = NdotV_1; + let _e157 = NoL_6; + let _e158 = NoH_4; + let _e159 = LoH_6; + let _e160 = specularIntensity_2; + let _e161 = specular(_e153, _e154, _e155, _e156, _e157, _e158, _e159, _e160); + specular_1 = _e161; + let _e163 = light_to_frag; + L = normalize(_e163); + let _e165 = L; + let _e166 = V_2; + H = normalize((_e165 + _e166)); + let _e169 = N_1; + let _e170 = L; + NoL_6 = clamp(dot(_e169, _e170), 0f, 1f); + let _e175 = N_1; + let _e176 = H; + NoH_4 = clamp(dot(_e175, _e176), 0f, 1f); + let _e181 = L; + let _e182 = H; + LoH_6 = clamp(dot(_e181, _e182), 0f, 1f); + let _e187 = diffuseColor_1; + let _e188 = roughness_9; + let _e189 = NdotV_1; + let _e190 = NoL_6; + let _e191 = LoH_6; + let _e192 = Fd_Burley(_e188, _e189, _e190, _e191); + diffuse = (_e187 * _e192); + let _e195 = diffuse; + let _e196 = specular_1; + let _e198 = light_1; + let _e202 = rangeAttenuation; + let _e203 = NoL_6; + return (((_e195 + _e196) * _e198.color.xyz) * (_e202 * _e203)); } 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 { @@ -651,46 +602,38 @@ fn dir_light(light_2: DirectionalLight, roughness_10: f32, NdotV_2: f32, normal: incident_light = _e56.direction.xyz; let _e60 = incident_light; let _e61 = view_1; - let _e63 = incident_light; - let _e64 = view_1; - half_vector = normalize((_e63 + _e64)); - let _e70 = normal_1; - let _e71 = incident_light; - let _e77 = normal_1; - let _e78 = incident_light; - NoL_7 = clamp(dot(_e77, _e78), 0f, 1f); - let _e86 = normal_1; - let _e87 = half_vector; - let _e93 = normal_1; - let _e94 = half_vector; - NoH_5 = clamp(dot(_e93, _e94), 0f, 1f); - let _e102 = incident_light; - let _e103 = half_vector; - let _e109 = incident_light; - let _e110 = half_vector; - LoH_7 = clamp(dot(_e109, _e110), 0f, 1f); - let _e116 = diffuseColor_3; - let _e121 = roughness_11; - let _e122 = NdotV_3; - let _e123 = NoL_7; - let _e124 = LoH_7; - let _e125 = Fd_Burley(_e121, _e122, _e123, _e124); - diffuse_1 = (_e116 * _e125); - let _e138 = F0_3; - let _e139 = roughness_11; - let _e140 = half_vector; - let _e141 = NdotV_3; - let _e142 = NoL_7; - let _e143 = NoH_5; - let _e144 = LoH_7; - let _e145 = specularIntensity_3; - let _e146 = specular(_e138, _e139, _e140, _e141, _e142, _e143, _e144, _e145); - specular_2 = _e146; - let _e148 = specular_2; - let _e149 = diffuse_1; - let _e151 = light_3; - let _e155 = NoL_7; - return (((_e148 + _e149) * _e151.color.xyz) * _e155); + half_vector = normalize((_e60 + _e61)); + let _e65 = normal_1; + let _e66 = incident_light; + NoL_7 = clamp(dot(_e65, _e66), 0f, 1f); + let _e72 = normal_1; + let _e73 = half_vector; + NoH_5 = clamp(dot(_e72, _e73), 0f, 1f); + let _e79 = incident_light; + let _e80 = half_vector; + LoH_7 = clamp(dot(_e79, _e80), 0f, 1f); + let _e86 = diffuseColor_3; + let _e87 = roughness_11; + let _e88 = NdotV_3; + let _e89 = NoL_7; + let _e90 = LoH_7; + let _e91 = Fd_Burley(_e87, _e88, _e89, _e90); + diffuse_1 = (_e86 * _e91); + let _e96 = F0_3; + let _e97 = roughness_11; + let _e98 = half_vector; + let _e99 = NdotV_3; + let _e100 = NoL_7; + let _e101 = NoH_5; + let _e102 = LoH_7; + let _e103 = specularIntensity_3; + let _e104 = specular(_e96, _e97, _e98, _e99, _e100, _e101, _e102, _e103); + specular_2 = _e104; + let _e106 = specular_2; + let _e107 = diffuse_1; + let _e109 = light_3; + let _e113 = NoL_7; + return (((_e106 + _e107) * _e109.color.xyz) * _e113); } fn main_1() { @@ -722,201 +665,190 @@ fn main_1() { let _e40 = global_3.base_color; output_color = _e40; let _e42 = output_color; - let _e44 = v_Uv_1; - let _e45 = textureSample(StandardMaterial_base_color_texture, StandardMaterial_base_color_texture_sampler, _e44); - output_color = (_e42 * _e45); - let _e48 = v_Uv_1; - let _e49 = textureSample(StandardMaterial_metallic_roughness_texture, StandardMaterial_metallic_roughness_texture_sampler, _e48); - metallic_roughness = _e49; - let _e51 = global_5.metallic; - let _e52 = metallic_roughness; - metallic = (_e51 * _e52.z); - let _e56 = global_4.perceptual_roughness; - let _e57 = metallic_roughness; - perceptual_roughness_2 = (_e56 * _e57.y); - let _e62 = perceptual_roughness_2; - let _e63 = perceptualRoughnessToRoughness(_e62); - roughness_12 = _e63; - let _e66 = v_WorldNormal_1; - N_2 = normalize(_e66); - let _e69 = v_WorldTangent_1; - let _e71 = v_WorldTangent_1; - T = normalize(_e71.xyz); - let _e77 = N_2; - let _e78 = T; - let _e80 = v_WorldTangent_1; - B = (cross(_e77, _e78) * _e80.w); - let _e85 = gl_FrontFacing_1; - if _e85 { - let _e86 = N_2; - local = _e86; + let _e43 = v_Uv_1; + let _e44 = textureSample(StandardMaterial_base_color_texture, StandardMaterial_base_color_texture_sampler, _e43); + output_color = (_e42 * _e44); + let _e46 = v_Uv_1; + let _e47 = textureSample(StandardMaterial_metallic_roughness_texture, StandardMaterial_metallic_roughness_texture_sampler, _e46); + metallic_roughness = _e47; + let _e49 = global_5.metallic; + let _e50 = metallic_roughness; + metallic = (_e49 * _e50.z); + let _e54 = global_4.perceptual_roughness; + let _e55 = metallic_roughness; + perceptual_roughness_2 = (_e54 * _e55.y); + let _e59 = perceptual_roughness_2; + let _e60 = perceptualRoughnessToRoughness(_e59); + roughness_12 = _e60; + let _e62 = v_WorldNormal_1; + N_2 = normalize(_e62); + let _e65 = v_WorldTangent_1; + T = normalize(_e65.xyz); + let _e69 = N_2; + let _e70 = T; + let _e72 = v_WorldTangent_1; + B = (cross(_e69, _e70) * _e72.w); + let _e77 = gl_FrontFacing_1; + if _e77 { + let _e78 = N_2; + local = _e78; } else { - let _e87 = N_2; - local = -(_e87); + let _e79 = N_2; + local = -(_e79); } - let _e90 = local; - N_2 = _e90; - let _e91 = gl_FrontFacing_1; - if _e91 { - let _e92 = T; - local_1 = _e92; + let _e82 = local; + N_2 = _e82; + let _e83 = gl_FrontFacing_1; + if _e83 { + let _e84 = T; + local_1 = _e84; } else { - let _e93 = T; - local_1 = -(_e93); + let _e85 = T; + local_1 = -(_e85); } - let _e96 = local_1; - T = _e96; - let _e97 = gl_FrontFacing_1; - if _e97 { - let _e98 = B; - local_2 = _e98; + let _e88 = local_1; + T = _e88; + let _e89 = gl_FrontFacing_1; + if _e89 { + let _e90 = B; + local_2 = _e90; } else { - let _e99 = B; - local_2 = -(_e99); + let _e91 = B; + local_2 = -(_e91); } - let _e102 = local_2; - B = _e102; - let _e103 = T; - let _e104 = B; - let _e105 = N_2; - TBN = mat3x3(vec3(_e103.x, _e103.y, _e103.z), vec3(_e104.x, _e104.y, _e104.z), vec3(_e105.x, _e105.y, _e105.z)); - let _e120 = TBN; - let _e122 = v_Uv_1; - let _e123 = textureSample(StandardMaterial_normal_map, StandardMaterial_normal_map_sampler, _e122); - let _e131 = v_Uv_1; - let _e132 = textureSample(StandardMaterial_normal_map, StandardMaterial_normal_map_sampler, _e131); - N_2 = (_e120 * normalize(((_e132.xyz * 2f) - vec3(1f)))); - let _e142 = v_Uv_1; - let _e143 = textureSample(StandardMaterial_occlusion_texture, StandardMaterial_occlusion_texture_sampler, _e142); - occlusion = _e143.x; - let _e146 = global_7.emissive; - emissive = _e146; - let _e148 = emissive; - let _e150 = emissive; - let _e153 = v_Uv_1; - let _e154 = textureSample(StandardMaterial_emissive_texture, StandardMaterial_emissive_texture_sampler, _e153); - let _e156 = (_e150.xyz * _e154.xyz); - emissive.x = _e156.x; - emissive.y = _e156.y; - emissive.z = _e156.z; - let _e163 = global_1.CameraPos; - let _e165 = v_WorldPosition_1; - let _e168 = global_1.CameraPos; - let _e170 = v_WorldPosition_1; - V_3 = normalize((_e168.xyz - _e170.xyz)); - let _e177 = N_2; - let _e178 = V_3; + let _e94 = local_2; + B = _e94; + let _e95 = T; + let _e96 = B; + let _e97 = N_2; + TBN = mat3x3(vec3(_e95.x, _e95.y, _e95.z), vec3(_e96.x, _e96.y, _e96.z), vec3(_e97.x, _e97.y, _e97.z)); + let _e112 = TBN; + let _e113 = v_Uv_1; + let _e114 = textureSample(StandardMaterial_normal_map, StandardMaterial_normal_map_sampler, _e113); + N_2 = (_e112 * normalize(((_e114.xyz * 2f) - vec3(1f)))); + let _e123 = v_Uv_1; + let _e124 = textureSample(StandardMaterial_occlusion_texture, StandardMaterial_occlusion_texture_sampler, _e123); + occlusion = _e124.x; + let _e127 = global_7.emissive; + emissive = _e127; + let _e129 = emissive; + let _e131 = emissive; + let _e133 = v_Uv_1; + let _e134 = textureSample(StandardMaterial_emissive_texture, StandardMaterial_emissive_texture_sampler, _e133); + let _e136 = (_e131.xyz * _e134.xyz); + emissive.x = _e136.x; + emissive.y = _e136.y; + emissive.z = _e136.z; + let _e143 = global_1.CameraPos; + let _e145 = v_WorldPosition_1; + V_3 = normalize((_e143.xyz - _e145.xyz)); + let _e150 = N_2; + let _e151 = V_3; + NdotV_4 = max(dot(_e150, _e151), 0.001f); + let _e157 = global_6.reflectance; + let _e159 = global_6.reflectance; + let _e162 = metallic; + let _e166 = output_color; + let _e168 = metallic; + F0_4 = (vec3((((0.16f * _e157) * _e159) * (1f - _e162))) + (_e166.xyz * vec3(_e168))); + let _e173 = output_color; + let _e176 = metallic; + diffuseColor_4 = (_e173.xyz * vec3((1f - _e176))); + let _e181 = V_3; let _e183 = N_2; - let _e184 = V_3; - NdotV_4 = max(dot(_e183, _e184), 0.001f); - let _e190 = global_6.reflectance; - let _e192 = global_6.reflectance; - let _e195 = metallic; - let _e199 = output_color; - let _e201 = metallic; - F0_4 = (vec3((((0.16f * _e190) * _e192) * (1f - _e195))) + (_e199.xyz * vec3(_e201))); - let _e206 = output_color; - let _e209 = metallic; - diffuseColor_4 = (_e206.xyz * vec3((1f - _e209))); - let _e214 = V_3; - let _e217 = V_3; - let _e219 = N_2; - R_4 = reflect(-(_e217), _e219); + R_4 = reflect(-(_e181), _e183); loop { - let _e227 = i; - let _e228 = global_2.NumLights; - let _e232 = i; - if !(((_e227 < i32(_e228.x)) && (_e232 < MAX_POINT_LIGHTS))) { + let _e191 = i; + let _e192 = global_2.NumLights; + let _e196 = i; + if !(((_e191 < i32(_e192.x)) && (_e196 < MAX_POINT_LIGHTS))) { break; } { - let _e239 = light_accum; - let _e240 = i; - let _e250 = i; - let _e252 = global_2.PointLights[_e250]; - let _e253 = roughness_12; - let _e254 = NdotV_4; - let _e255 = N_2; - let _e256 = V_3; - let _e257 = R_4; - let _e258 = F0_4; - let _e259 = diffuseColor_4; - let _e260 = point_light(_e252, _e253, _e254, _e255, _e256, _e257, _e258, _e259); - light_accum = (_e239 + _e260); + let _e203 = light_accum; + let _e204 = i; + let _e206 = global_2.PointLights[_e204]; + let _e207 = roughness_12; + let _e208 = NdotV_4; + let _e209 = N_2; + let _e210 = V_3; + let _e211 = R_4; + let _e212 = F0_4; + let _e213 = diffuseColor_4; + let _e214 = point_light(_e206, _e207, _e208, _e209, _e210, _e211, _e212, _e213); + light_accum = (_e203 + _e214); } continuing { - let _e236 = i; - i = (_e236 + 1i); + let _e200 = i; + i = (_e200 + 1i); } } loop { - let _e264 = i_1; - let _e265 = global_2.NumLights; - let _e269 = i_1; - if !(((_e264 < i32(_e265.y)) && (_e269 < MAX_DIRECTIONAL_LIGHTS))) { + let _e218 = i_1; + let _e219 = global_2.NumLights; + let _e223 = i_1; + if !(((_e218 < i32(_e219.y)) && (_e223 < MAX_DIRECTIONAL_LIGHTS))) { break; } { - let _e276 = light_accum; - let _e277 = i_1; - let _e287 = i_1; - let _e289 = global_2.DirectionalLights[_e287]; - let _e290 = roughness_12; - let _e291 = NdotV_4; - let _e292 = N_2; - let _e293 = V_3; - let _e294 = R_4; - let _e295 = F0_4; - let _e296 = diffuseColor_4; - let _e297 = dir_light(_e289, _e290, _e291, _e292, _e293, _e294, _e295, _e296); - light_accum = (_e276 + _e297); + let _e230 = light_accum; + let _e231 = i_1; + let _e233 = global_2.DirectionalLights[_e231]; + let _e234 = roughness_12; + let _e235 = NdotV_4; + let _e236 = N_2; + let _e237 = V_3; + let _e238 = R_4; + let _e239 = F0_4; + let _e240 = diffuseColor_4; + let _e241 = dir_light(_e233, _e234, _e235, _e236, _e237, _e238, _e239, _e240); + light_accum = (_e230 + _e241); } continuing { - let _e273 = i_1; - i_1 = (_e273 + 1i); + let _e227 = i_1; + i_1 = (_e227 + 1i); } } - let _e302 = diffuseColor_4; - let _e304 = NdotV_4; - let _e305 = EnvBRDFApprox(_e302, 1f, _e304); - diffuse_ambient = _e305; - let _e310 = F0_4; - let _e311 = perceptual_roughness_2; - let _e312 = NdotV_4; - let _e313 = EnvBRDFApprox(_e310, _e311, _e312); - specular_ambient = _e313; - let _e315 = output_color; - let _e317 = light_accum; - output_color.x = _e317.x; - output_color.y = _e317.y; - output_color.z = _e317.z; - let _e324 = output_color; - let _e326 = output_color; - let _e328 = diffuse_ambient; - let _e329 = specular_ambient; - let _e331 = global_2.AmbientColor; - let _e334 = occlusion; - let _e336 = (_e326.xyz + (((_e328 + _e329) * _e331.xyz) * _e334)); - output_color.x = _e336.x; - output_color.y = _e336.y; - output_color.z = _e336.z; - let _e343 = output_color; - let _e345 = output_color; - let _e347 = emissive; - let _e349 = output_color; - let _e352 = (_e345.xyz + (_e347.xyz * _e349.w)); - output_color.x = _e352.x; - output_color.y = _e352.y; - output_color.z = _e352.z; - let _e359 = output_color; - let _e361 = output_color; - let _e363 = output_color; - let _e365 = reinhard_luminance(_e363.xyz); - output_color.x = _e365.x; - output_color.y = _e365.y; - output_color.z = _e365.z; - let _e372 = output_color; - o_Target = _e372; + let _e243 = diffuseColor_4; + let _e245 = NdotV_4; + let _e246 = EnvBRDFApprox(_e243, 1f, _e245); + diffuse_ambient = _e246; + let _e248 = F0_4; + let _e249 = perceptual_roughness_2; + let _e250 = NdotV_4; + let _e251 = EnvBRDFApprox(_e248, _e249, _e250); + specular_ambient = _e251; + let _e253 = output_color; + let _e255 = light_accum; + output_color.x = _e255.x; + output_color.y = _e255.y; + output_color.z = _e255.z; + let _e262 = output_color; + let _e264 = output_color; + let _e266 = diffuse_ambient; + let _e267 = specular_ambient; + let _e269 = global_2.AmbientColor; + let _e272 = occlusion; + let _e274 = (_e264.xyz + (((_e266 + _e267) * _e269.xyz) * _e272)); + output_color.x = _e274.x; + output_color.y = _e274.y; + output_color.z = _e274.z; + let _e281 = output_color; + let _e283 = output_color; + let _e285 = emissive; + let _e287 = output_color; + let _e290 = (_e283.xyz + (_e285.xyz * _e287.w)); + output_color.x = _e290.x; + output_color.y = _e290.y; + output_color.z = _e290.z; + let _e297 = output_color; + let _e299 = output_color; + let _e301 = reinhard_luminance(_e299.xyz); + output_color.x = _e301.x; + output_color.y = _e301.y; + output_color.z = _e301.z; + let _e308 = output_color; + o_Target = _e308; return; } diff --git a/naga/tests/out/wgsl/bits_glsl.frag.wgsl b/naga/tests/out/wgsl/bits_glsl.frag.wgsl index e8365dd1ee..3513d1ba25 100644 --- a/naga/tests/out/wgsl/bits_glsl.frag.wgsl +++ b/naga/tests/out/wgsl/bits_glsl.frag.wgsl @@ -10,98 +10,98 @@ fn main_1() { var f2_: vec2 = vec2(0f); var f4_: vec4 = vec4(0f); - let _e33 = f4_; - u = pack4x8snorm(_e33); - let _e36 = f4_; - u = pack4x8unorm(_e36); - let _e39 = f2_; - u = pack2x16unorm(_e39); - let _e42 = f2_; - u = pack2x16snorm(_e42); - let _e45 = f2_; - u = pack2x16float(_e45); + let _e32 = f4_; + u = pack4x8snorm(_e32); + let _e34 = f4_; + u = pack4x8unorm(_e34); + let _e36 = f2_; + u = pack2x16unorm(_e36); + let _e38 = f2_; + u = pack2x16snorm(_e38); + let _e40 = f2_; + u = pack2x16float(_e40); + let _e42 = u; + f4_ = unpack4x8snorm(_e42); + let _e44 = u; + f4_ = unpack4x8unorm(_e44); + let _e46 = u; + f2_ = unpack2x16snorm(_e46); let _e48 = u; - f4_ = unpack4x8snorm(_e48); - let _e51 = u; - f4_ = unpack4x8unorm(_e51); - let _e54 = u; - f2_ = unpack2x16snorm(_e54); - let _e57 = u; - f2_ = unpack2x16unorm(_e57); - let _e60 = u; - f2_ = unpack2x16float(_e60); - let _e66 = i; - let _e67 = i; - i = insertBits(_e66, _e67, 5u, 10u); - let _e77 = i2_; - let _e78 = i2_; - i2_ = insertBits(_e77, _e78, 5u, 10u); - let _e88 = i3_; - let _e89 = i3_; - i3_ = insertBits(_e88, _e89, 5u, 10u); - let _e99 = i4_; - let _e100 = i4_; - i4_ = insertBits(_e99, _e100, 5u, 10u); - let _e110 = u; - let _e111 = u; - u = insertBits(_e110, _e111, 5u, 10u); - let _e121 = u2_; - let _e122 = u2_; - u2_ = insertBits(_e121, _e122, 5u, 10u); - let _e132 = u3_; - let _e133 = u3_; - u3_ = insertBits(_e132, _e133, 5u, 10u); - let _e143 = u4_; - let _e144 = u4_; - u4_ = insertBits(_e143, _e144, 5u, 10u); - let _e153 = i; - i = extractBits(_e153, 5u, 10u); - let _e162 = i2_; - i2_ = extractBits(_e162, 5u, 10u); - let _e171 = i3_; - i3_ = extractBits(_e171, 5u, 10u); - let _e180 = i4_; - i4_ = extractBits(_e180, 5u, 10u); - let _e189 = u; - u = extractBits(_e189, 5u, 10u); - let _e198 = u2_; - u2_ = extractBits(_e198, 5u, 10u); - let _e207 = u3_; - u3_ = extractBits(_e207, 5u, 10u); - let _e216 = u4_; - u4_ = extractBits(_e216, 5u, 10u); - let _e223 = i; - i = firstTrailingBit(_e223); - let _e226 = i2_; - i2_ = firstTrailingBit(_e226); - let _e229 = i3_; - i3_ = firstTrailingBit(_e229); - let _e232 = i4_; - i4_ = firstTrailingBit(_e232); - let _e235 = u; - i = i32(firstTrailingBit(_e235)); - let _e239 = u2_; - i2_ = vec2(firstTrailingBit(_e239)); - let _e243 = u3_; - i3_ = vec3(firstTrailingBit(_e243)); - let _e247 = u4_; - i4_ = vec4(firstTrailingBit(_e247)); - let _e251 = i; - i = firstLeadingBit(_e251); - let _e254 = i2_; - i2_ = firstLeadingBit(_e254); - let _e257 = i3_; - i3_ = firstLeadingBit(_e257); - let _e260 = i4_; - i4_ = firstLeadingBit(_e260); - let _e263 = u; - i = i32(firstLeadingBit(_e263)); - let _e267 = u2_; - i2_ = vec2(firstLeadingBit(_e267)); - let _e271 = u3_; - i3_ = vec3(firstLeadingBit(_e271)); - let _e275 = u4_; - i4_ = vec4(firstLeadingBit(_e275)); + f2_ = unpack2x16unorm(_e48); + let _e50 = u; + f2_ = unpack2x16float(_e50); + let _e52 = i; + let _e53 = i; + i = insertBits(_e52, _e53, 5u, 10u); + let _e59 = i2_; + let _e60 = i2_; + i2_ = insertBits(_e59, _e60, 5u, 10u); + let _e66 = i3_; + let _e67 = i3_; + i3_ = insertBits(_e66, _e67, 5u, 10u); + let _e73 = i4_; + let _e74 = i4_; + i4_ = insertBits(_e73, _e74, 5u, 10u); + let _e80 = u; + let _e81 = u; + u = insertBits(_e80, _e81, 5u, 10u); + let _e87 = u2_; + let _e88 = u2_; + u2_ = insertBits(_e87, _e88, 5u, 10u); + let _e94 = u3_; + let _e95 = u3_; + u3_ = insertBits(_e94, _e95, 5u, 10u); + let _e101 = u4_; + let _e102 = u4_; + u4_ = insertBits(_e101, _e102, 5u, 10u); + let _e108 = i; + i = extractBits(_e108, 5u, 10u); + let _e114 = i2_; + i2_ = extractBits(_e114, 5u, 10u); + let _e120 = i3_; + i3_ = extractBits(_e120, 5u, 10u); + let _e126 = i4_; + i4_ = extractBits(_e126, 5u, 10u); + let _e132 = u; + u = extractBits(_e132, 5u, 10u); + let _e138 = u2_; + u2_ = extractBits(_e138, 5u, 10u); + let _e144 = u3_; + u3_ = extractBits(_e144, 5u, 10u); + let _e150 = u4_; + u4_ = extractBits(_e150, 5u, 10u); + let _e156 = i; + i = firstTrailingBit(_e156); + let _e158 = i2_; + i2_ = firstTrailingBit(_e158); + let _e160 = i3_; + i3_ = firstTrailingBit(_e160); + let _e162 = i4_; + i4_ = firstTrailingBit(_e162); + let _e164 = u; + i = i32(firstTrailingBit(_e164)); + let _e167 = u2_; + i2_ = vec2(firstTrailingBit(_e167)); + let _e170 = u3_; + i3_ = vec3(firstTrailingBit(_e170)); + let _e173 = u4_; + i4_ = vec4(firstTrailingBit(_e173)); + let _e176 = i; + i = firstLeadingBit(_e176); + let _e178 = i2_; + i2_ = firstLeadingBit(_e178); + let _e180 = i3_; + i3_ = firstLeadingBit(_e180); + let _e182 = i4_; + i4_ = firstLeadingBit(_e182); + let _e184 = u; + i = i32(firstLeadingBit(_e184)); + let _e187 = u2_; + i2_ = vec2(firstLeadingBit(_e187)); + let _e190 = u3_; + i3_ = vec3(firstLeadingBit(_e190)); + let _e193 = u4_; + i4_ = vec4(firstLeadingBit(_e193)); return; } diff --git a/naga/tests/out/wgsl/bool-select.frag.wgsl b/naga/tests/out/wgsl/bool-select.frag.wgsl index 747ff677a2..4045a3de45 100644 --- a/naga/tests/out/wgsl/bool-select.frag.wgsl +++ b/naga/tests/out/wgsl/bool-select.frag.wgsl @@ -21,19 +21,19 @@ fn TevPerCompGT_1(a_2: vec3, b_2: vec3) -> vec3 { a_3 = a_2; b_3 = b_2; - let _e7 = a_3; - let _e8 = b_3; - return select(vec3(0f), vec3(1f), (_e7 > _e8)); + let _e5 = a_3; + let _e6 = b_3; + return select(vec3(0f), vec3(1f), (_e5 > _e6)); } fn main_1() { let _e1 = o_color; - let _e11 = TevPerCompGT_1(vec3(3f), vec3(5f)); - o_color.x = _e11.x; - o_color.y = _e11.y; - o_color.z = _e11.z; - let _e23 = TevPerCompGT(3f, 5f); - o_color.w = _e23; + let _e7 = TevPerCompGT_1(vec3(3f), vec3(5f)); + o_color.x = _e7.x; + o_color.y = _e7.y; + o_color.z = _e7.z; + let _e17 = TevPerCompGT(3f, 5f); + o_color.w = _e17; return; } diff --git a/naga/tests/out/wgsl/clamp-splat.vert.wgsl b/naga/tests/out/wgsl/clamp-splat.vert.wgsl index 3425e57588..909ff07209 100644 --- a/naga/tests/out/wgsl/clamp-splat.vert.wgsl +++ b/naga/tests/out/wgsl/clamp-splat.vert.wgsl @@ -6,9 +6,9 @@ var a_pos_1: vec2; var gl_Position: vec4; fn main_1() { - let _e5 = a_pos_1; - let _e10 = clamp(_e5, vec2(0f), vec2(1f)); - gl_Position = vec4(_e10.x, _e10.y, 0f, 1f); + let _e2 = a_pos_1; + let _e7 = clamp(_e2, vec2(0f), vec2(1f)); + gl_Position = vec4(_e7.x, _e7.y, 0f, 1f); return; } diff --git a/naga/tests/out/wgsl/double-math-functions.frag.wgsl b/naga/tests/out/wgsl/double-math-functions.frag.wgsl index 914af92d24..01c798586a 100644 --- a/naga/tests/out/wgsl/double-math-functions.frag.wgsl +++ b/naga/tests/out/wgsl/double-math-functions.frag.wgsl @@ -34,64 +34,59 @@ fn main_1() { let _e10 = a; let _e11 = b; m = mat4x4(vec4(_e8.x, _e8.y, _e8.z, _e8.w), vec4(_e9.x, _e9.y, _e9.z, _e9.w), vec4(_e10.x, _e10.y, _e10.z, _e10.w), vec4(_e11.x, _e11.y, _e11.z, _e11.w)); - let _e37 = a; - ceilOut = ceil(_e37); - let _e41 = a; - roundOut = round(_e41); + let _e36 = a; + ceilOut = ceil(_e36); + let _e39 = a; + roundOut = round(_e39); + let _e42 = a; + floorOut = floor(_e42); let _e45 = a; - floorOut = floor(_e45); - let _e49 = a; - fractOut = fract(_e49); - let _e53 = a; - truncOut = trunc(_e53); + fractOut = fract(_e45); + let _e48 = a; + truncOut = trunc(_e48); + let _e51 = a; + absOut = abs(_e51); + let _e54 = a; + sqrtOut = sqrt(_e54); let _e57 = a; - absOut = abs(_e57); - let _e61 = a; - sqrtOut = sqrt(_e61); - let _e65 = a; - inversesqrtOut = inverseSqrt(_e65); + inversesqrtOut = inverseSqrt(_e57); + let _e60 = a; + signOut = sign(_e60); + let _e63 = m; + transposeOut = transpose(_e63); + let _e66 = a; + normalizeOut = normalize(_e66); let _e69 = a; - signOut = sign(_e69); - let _e73 = m; - transposeOut = transpose(_e73); - let _e77 = a; - normalizeOut = normalize(_e77); - let _e81 = a; - lengthOut = length(_e81); - let _e85 = m; - determinantOut = determinant(_e85); + lengthOut = length(_e69); + let _e72 = m; + determinantOut = determinant(_e72); + let _e75 = a; + let _e77 = b; + modOut = (_e75.x - (floor((_e75.x / _e77.x)) * _e77.x)); + let _e84 = a; + let _e85 = b; + dotOut = dot(_e84, _e85); let _e88 = a; - let _e90 = b; + let _e89 = b; + maxOut = max(_e88, _e89); let _e92 = a; - let _e94 = b; - modOut = (_e92.x - (floor((_e92.x / _e94.x)) * _e94.x)); - let _e103 = a; - let _e104 = b; - dotOut = dot(_e103, _e104); - let _e109 = a; - let _e110 = b; - maxOut = max(_e109, _e110); - let _e115 = a; - let _e116 = b; - minOut = min(_e115, _e116); - let _e121 = a; - let _e122 = b; - reflectOut = reflect(_e121, _e122); - let _e125 = a; - let _e127 = b; - let _e129 = a; - let _e131 = b; - crossOut = cross(_e129.xyz, _e131.xyz); - let _e137 = a; - let _e138 = b; - distanceOut = distance(_e137, _e138); - let _e143 = a; - let _e144 = b; - stepOut = step(_e143, _e144); - let _e147 = a; - let _e150 = a; - let _e152 = i; - ldexpOut = ldexp(_e150.x, _e152); + let _e93 = b; + minOut = min(_e92, _e93); + let _e96 = a; + let _e97 = b; + reflectOut = reflect(_e96, _e97); + let _e100 = a; + let _e102 = b; + crossOut = cross(_e100.xyz, _e102.xyz); + let _e106 = a; + let _e107 = b; + distanceOut = distance(_e106, _e107); + let _e110 = a; + let _e111 = b; + stepOut = step(_e110, _e111); + let _e114 = a; + let _e116 = i; + ldexpOut = ldexp(_e114.x, _e116); smoothStepScalar = f64(smoothstep(0f, 1f, 0.5f)); smoothStepVector = smoothstep(vec4(0.0lf), vec4(1.0lf), vec4(0.5lf)); smoothStepMixed = smoothstep(vec4(0.0lf), vec4(1.0lf), vec4(0.5lf)); diff --git a/naga/tests/out/wgsl/images.frag.wgsl b/naga/tests/out/wgsl/images.frag.wgsl index e7eada96e8..6b57b52aeb 100644 --- a/naga/tests/out/wgsl/images.frag.wgsl +++ b/naga/tests/out/wgsl/images.frag.wgsl @@ -23,11 +23,11 @@ fn testImg1D(coord: i32) { coord_1 = coord; let _e10 = textureDimensions(img1D); size = i32(_e10); + let _e13 = coord_1; + textureStore(img1D, _e13, vec4(2f)); let _e17 = coord_1; - textureStore(img1D, _e17, vec4(2f)); - let _e22 = coord_1; - let _e23 = textureLoad(img1D, _e22); - c = _e23; + let _e18 = textureLoad(img1D, _e17); + c = _e18; return; } @@ -40,11 +40,11 @@ fn testImg1DArray(coord_2: vec2) { let _e10 = textureDimensions(img1DArray); let _e11 = textureNumLayers(img1DArray); size_1 = vec2(vec2(vec2(_e10, _e11))); - let _e17 = coord_3; - let _e20 = textureLoad(img1DArray, _e17.x, _e17.y); - c_1 = _e20; - let _e26 = coord_3; - textureStore(img1DArray, _e26.x, _e26.y, vec4(2f)); + let _e16 = coord_3; + let _e19 = textureLoad(img1DArray, _e16.x, _e16.y); + c_1 = _e19; + let _e21 = coord_3; + textureStore(img1DArray, _e21.x, _e21.y, vec4(2f)); return; } @@ -56,11 +56,11 @@ fn testImg2D(coord_4: vec2) { coord_5 = coord_4; let _e10 = textureDimensions(img2D); size_2 = vec2(vec2(_e10)); - let _e15 = coord_5; - let _e16 = textureLoad(img2D, _e15); - c_2 = _e16; - let _e22 = coord_5; - textureStore(img2D, _e22, vec4(2f)); + let _e14 = coord_5; + let _e15 = textureLoad(img2D, _e14); + c_2 = _e15; + let _e17 = coord_5; + textureStore(img2D, _e17, vec4(2f)); return; } @@ -73,11 +73,11 @@ fn testImg2DArray(coord_6: vec3) { let _e10 = textureDimensions(img2DArray); let _e13 = textureNumLayers(img2DArray); size_3 = vec3(vec3(vec3(_e10.x, _e10.y, _e13))); - let _e19 = coord_7; - let _e22 = textureLoad(img2DArray, _e19.xy, _e19.z); - c_3 = _e22; - let _e28 = coord_7; - textureStore(img2DArray, _e28.xy, _e28.z, vec4(2f)); + let _e18 = coord_7; + let _e21 = textureLoad(img2DArray, _e18.xy, _e18.z); + c_3 = _e21; + let _e23 = coord_7; + textureStore(img2DArray, _e23.xy, _e23.z, vec4(2f)); return; } @@ -89,11 +89,11 @@ fn testImg3D(coord_8: vec3) { coord_9 = coord_8; let _e10 = textureDimensions(img3D); size_4 = vec3(vec3(_e10)); - let _e15 = coord_9; - let _e16 = textureLoad(img3D, _e15); - c_4 = _e16; - let _e22 = coord_9; - textureStore(img3D, _e22, vec4(2f)); + let _e14 = coord_9; + let _e15 = textureLoad(img3D, _e14); + c_4 = _e15; + let _e17 = coord_9; + textureStore(img3D, _e17, vec4(2f)); return; } @@ -105,9 +105,9 @@ fn testImgReadOnly(coord_10: vec2) { coord_11 = coord_10; let _e10 = textureDimensions(img2D); size_5 = vec2(vec2(_e10)); - let _e15 = coord_11; - let _e16 = textureLoad(imgReadOnly, _e15); - c_5 = _e16; + let _e14 = coord_11; + let _e15 = textureLoad(imgReadOnly, _e14); + c_5 = _e15; return; } @@ -118,8 +118,8 @@ fn testImgWriteOnly(coord_12: vec2) { coord_13 = coord_12; let _e10 = textureDimensions(img2D); size_6 = vec2(vec2(_e10)); - let _e18 = coord_13; - textureStore(imgWriteOnly, _e18, vec4(2f)); + let _e14 = coord_13; + textureStore(imgWriteOnly, _e14, vec4(2f)); return; } diff --git a/naga/tests/out/wgsl/inverse-polyfill.frag.wgsl b/naga/tests/out/wgsl/inverse-polyfill.frag.wgsl index d22847c975..1efea1d9f6 100644 --- a/naga/tests/out/wgsl/inverse-polyfill.frag.wgsl +++ b/naga/tests/out/wgsl/inverse-polyfill.frag.wgsl @@ -19,12 +19,12 @@ fn main_1() { let _e39 = b3_; let _e40 = a3_; m3_ = mat3x3(vec3(_e38.x, _e38.y, _e38.z), vec3(_e39.x, _e39.y, _e39.z), vec3(_e40.x, _e40.y, _e40.z)); - let _e64 = m4_; - m4_inverse = _naga_inverse_4x4_f32(_e64); - let _e68 = m3_; - m3_inverse = _naga_inverse_3x3_f32(_e68); - let _e72 = m2_; - m2_inverse = _naga_inverse_2x2_f32(_e72); + let _e63 = m4_; + m4_inverse = _naga_inverse_4x4_f32(_e63); + let _e66 = m3_; + m3_inverse = _naga_inverse_3x3_f32(_e66); + let _e69 = m2_; + m2_inverse = _naga_inverse_2x2_f32(_e69); return; } diff --git a/naga/tests/out/wgsl/math-functions.frag.wgsl b/naga/tests/out/wgsl/math-functions.frag.wgsl index b01c3322ae..10dc84c9a5 100644 --- a/naga/tests/out/wgsl/math-functions.frag.wgsl +++ b/naga/tests/out/wgsl/math-functions.frag.wgsl @@ -53,108 +53,99 @@ fn main_1() { let _e8 = a; let _e9 = b; m = mat4x4(vec4(_e6.x, _e6.y, _e6.z, _e6.w), vec4(_e7.x, _e7.y, _e7.z, _e7.w), vec4(_e8.x, _e8.y, _e8.z, _e8.w), vec4(_e9.x, _e9.y, _e9.z, _e9.w)); - let _e35 = a; - ceilOut = ceil(_e35); - let _e39 = a; - roundOut = round(_e39); + let _e34 = a; + ceilOut = ceil(_e34); + let _e37 = a; + roundOut = round(_e37); + let _e40 = a; + floorOut = floor(_e40); let _e43 = a; - floorOut = floor(_e43); - let _e47 = a; - fractOut = fract(_e47); - let _e51 = a; - truncOut = trunc(_e51); + fractOut = fract(_e43); + let _e46 = a; + truncOut = trunc(_e46); + let _e49 = a; + sinOut = sin(_e49); + let _e52 = a; + absOut = abs(_e52); let _e55 = a; - sinOut = sin(_e55); - let _e59 = a; - absOut = abs(_e59); - let _e63 = a; - sqrtOut = sqrt(_e63); + sqrtOut = sqrt(_e55); + let _e58 = a; + inversesqrtOut = inverseSqrt(_e58); + let _e61 = a; + expOut = exp(_e61); + let _e64 = a; + exp2Out = exp2(_e64); let _e67 = a; - inversesqrtOut = inverseSqrt(_e67); - let _e71 = a; - expOut = exp(_e71); - let _e75 = a; - exp2Out = exp2(_e75); + signOut = sign(_e67); + let _e70 = m; + transposeOut = transpose(_e70); + let _e73 = a; + normalizeOut = normalize(_e73); + let _e76 = a; + sinhOut = sinh(_e76); let _e79 = a; - signOut = sign(_e79); - let _e83 = m; - transposeOut = transpose(_e83); - let _e87 = a; - normalizeOut = normalize(_e87); + cosOut = cos(_e79); + let _e82 = a; + coshOut = cosh(_e82); + let _e85 = a; + tanOut = tan(_e85); + let _e88 = a; + tanhOut = tanh(_e88); let _e91 = a; - sinhOut = sinh(_e91); - let _e95 = a; - cosOut = cos(_e95); - let _e99 = a; - coshOut = cosh(_e99); + acosOut = acos(_e91); + let _e94 = a; + asinOut = asin(_e94); + let _e97 = a; + logOut = log(_e97); + let _e100 = a; + log2Out = log2(_e100); let _e103 = a; - tanOut = tan(_e103); - let _e107 = a; - tanhOut = tanh(_e107); - let _e111 = a; - acosOut = acos(_e111); + lengthOut = length(_e103); + let _e106 = m; + determinantOut = determinant(_e106); + let _e109 = i; + bitCountOut = countOneBits(_e109); + let _e112 = i; + bitfieldReverseOut = reverseBits(_e112); let _e115 = a; - asinOut = asin(_e115); + atanOut = atan(_e115.x); let _e119 = a; - logOut = log(_e119); - let _e123 = a; - log2Out = log2(_e123); - let _e127 = a; - lengthOut = length(_e127); - let _e131 = m; - determinantOut = determinant(_e131); - let _e135 = i; - bitCountOut = countOneBits(_e135); - let _e139 = i; - bitfieldReverseOut = reverseBits(_e139); + let _e121 = a; + atan2Out = atan2(_e119.x, _e121.y); + let _e125 = a; + let _e127 = b; + modOut = (_e125.x - (floor((_e125.x / _e127.x)) * _e127.x)); + let _e134 = a; + let _e135 = b; + powOut = pow(_e134, _e135); + let _e138 = a; + let _e139 = b; + dotOut = dot(_e138, _e139); let _e142 = a; - let _e144 = a; - atanOut = atan(_e144.x); - let _e148 = a; + let _e143 = b; + maxOut = max(_e142, _e143); + let _e146 = a; + let _e147 = b; + minOut = min(_e146, _e147); let _e150 = a; - let _e152 = a; + let _e151 = b; + reflectOut = reflect(_e150, _e151); let _e154 = a; - atan2Out = atan2(_e152.x, _e154.y); - let _e158 = a; - let _e160 = b; - let _e162 = a; - let _e164 = b; - modOut = (_e162.x - (floor((_e162.x / _e164.x)) * _e164.x)); + let _e156 = b; + crossOut = cross(_e154.xyz, _e156.xyz); + let _e160 = a; + let _e161 = b; + distanceOut = distance(_e160, _e161); + let _e164 = a; + let _e165 = b; + stepOut = step(_e164, _e165); + let _e168 = a; + let _e170 = i; + ldexpOut = ldexp(_e168.x, _e170); let _e173 = a; - let _e174 = b; - powOut = pow(_e173, _e174); - let _e179 = a; - let _e180 = b; - dotOut = dot(_e179, _e180); - let _e185 = a; - let _e186 = b; - maxOut = max(_e185, _e186); - let _e191 = a; - let _e192 = b; - minOut = min(_e191, _e192); - let _e197 = a; - let _e198 = b; - reflectOut = reflect(_e197, _e198); - let _e201 = a; - let _e203 = b; - let _e205 = a; - let _e207 = b; - crossOut = cross(_e205.xyz, _e207.xyz); - let _e213 = a; - let _e214 = b; - distanceOut = distance(_e213, _e214); - let _e219 = a; - let _e220 = b; - stepOut = step(_e219, _e220); - let _e223 = a; - let _e226 = a; - let _e228 = i; - ldexpOut = ldexp(_e226.x, _e228); - let _e232 = a; - rad = radians(_e232); - let _e235 = a; - let _e237 = a; - deg = degrees(_e237.x); + rad = radians(_e173); + let _e176 = a; + deg = degrees(_e176.x); smoothStepScalar = smoothstep(0f, 1f, 0.5f); smoothStepVector = smoothstep(vec4(0f), vec4(1f), vec4(0.5f)); smoothStepMixed = smoothstep(vec4(0f), vec4(1f), vec4(0.5f)); diff --git a/naga/tests/out/wgsl/sampler-functions.frag.wgsl b/naga/tests/out/wgsl/sampler-functions.frag.wgsl index 3530629088..0f79bd9693 100644 --- a/naga/tests/out/wgsl/sampler-functions.frag.wgsl +++ b/naga/tests/out/wgsl/sampler-functions.frag.wgsl @@ -5,12 +5,11 @@ fn CalcShadowPCF1_(T_P_t_TextureDepth: texture_depth_2d, S_P_t_TextureDepth: sam t_ProjCoord_1 = t_ProjCoord; let _e6 = t_Res; let _e7 = t_ProjCoord_1; - let _e9 = t_ProjCoord_1; - let _e10 = _e9.xyz; - let _e13 = textureSampleCompare(T_P_t_TextureDepth, S_P_t_TextureDepth, _e10.xy, _e10.z); - t_Res = (_e6 + (_e13 * 0.2f)); - let _e19 = t_Res; - return _e19; + let _e8 = _e7.xyz; + let _e11 = textureSampleCompare(T_P_t_TextureDepth, S_P_t_TextureDepth, _e8.xy, _e8.z); + t_Res = (_e6 + (_e11 * 0.2f)); + let _e17 = t_Res; + return _e17; } fn CalcShadowPCF(T_P_t_TextureDepth_1: texture_depth_2d, S_P_t_TextureDepth_1: sampler_comparison, t_ProjCoord_2: vec3, t_Bias: f32) -> f32 { @@ -23,9 +22,8 @@ fn CalcShadowPCF(T_P_t_TextureDepth_1: texture_depth_2d, S_P_t_TextureDepth_1: s let _e9 = t_Bias_1; t_ProjCoord_3.z = (_e7.z + _e9); let _e11 = t_ProjCoord_3; - let _e13 = t_ProjCoord_3; - let _e15 = CalcShadowPCF1_(T_P_t_TextureDepth_1, S_P_t_TextureDepth_1, _e13.xyz); - return _e15; + let _e13 = CalcShadowPCF1_(T_P_t_TextureDepth_1, S_P_t_TextureDepth_1, _e11.xyz); + return _e13; } fn main_1() { diff --git a/naga/tests/out/wgsl/samplers.frag.wgsl b/naga/tests/out/wgsl/samplers.frag.wgsl index c51f05305d..170b0491b3 100644 --- a/naga/tests/out/wgsl/samplers.frag.wgsl +++ b/naga/tests/out/wgsl/samplers.frag.wgsl @@ -42,96 +42,82 @@ fn testTex1D(coord: f32) { var c: vec4; coord_1 = coord; - let _e22 = textureDimensions(tex1D, 0i); - size1D = i32(_e22); - let _e25 = textureNumLevels(tex1D); - levels = i32(_e25); + let _e21 = textureDimensions(tex1D, 0i); + size1D = i32(_e21); + let _e24 = textureNumLevels(tex1D); + levels = i32(_e24); + let _e28 = coord_1; + let _e29 = textureSample(tex1D, samp, _e28); + c = _e29; let _e30 = coord_1; - let _e31 = textureSample(tex1D, samp, _e30); - c = _e31; - let _e35 = coord_1; - let _e38 = textureSampleGrad(tex1D, samp, _e35, 4f, 4f); + let _e33 = textureSampleGrad(tex1D, samp, _e30, 4f, 4f); + c = _e33; + let _e34 = coord_1; + let _e38 = textureSampleGrad(tex1D, samp, _e34, 4f, 4f, 5i); c = _e38; - let _e43 = coord_1; - let _e47 = textureSampleGrad(tex1D, samp, _e43, 4f, 4f, 5i); - c = _e47; - let _e50 = coord_1; - let _e52 = textureSampleLevel(tex1D, samp, _e50, 3f); - c = _e52; + let _e39 = coord_1; + let _e41 = textureSampleLevel(tex1D, samp, _e39, 3f); + c = _e41; + let _e42 = coord_1; + let _e45 = textureSampleLevel(tex1D, samp, _e42, 3f, 5i); + c = _e45; + let _e46 = coord_1; + let _e48 = textureSample(tex1D, samp, _e46, 5i); + c = _e48; + let _e49 = coord_1; + let _e51 = vec2(_e49, 6f); + let _e55 = textureSample(tex1D, samp, (_e51.x / _e51.y)); + c = _e55; let _e56 = coord_1; - let _e59 = textureSampleLevel(tex1D, samp, _e56, 3f, 5i); - c = _e59; - let _e62 = coord_1; - let _e64 = textureSample(tex1D, samp, _e62, 5i); - c = _e64; - let _e65 = coord_1; - let _e68 = coord_1; - let _e70 = vec2(_e68, 6f); - let _e74 = textureSample(tex1D, samp, (_e70.x / _e70.y)); - c = _e74; - let _e75 = coord_1; - let _e80 = coord_1; - let _e84 = vec4(_e80, 0f, 0f, 6f); - let _e90 = textureSample(tex1D, samp, (_e84.xyz / vec3(_e84.w)).x); - c = _e90; - let _e91 = coord_1; - let _e96 = coord_1; - let _e98 = vec2(_e96, 6f); - let _e104 = textureSampleGrad(tex1D, samp, (_e98.x / _e98.y), 4f, 4f); - c = _e104; - let _e105 = coord_1; - let _e112 = coord_1; - let _e116 = vec4(_e112, 0f, 0f, 6f); - let _e124 = textureSampleGrad(tex1D, samp, (_e116.xyz / vec3(_e116.w)).x, 4f, 4f); - c = _e124; - let _e125 = coord_1; - let _e131 = coord_1; - let _e133 = vec2(_e131, 6f); - let _e140 = textureSampleGrad(tex1D, samp, (_e133.x / _e133.y), 4f, 4f, 5i); - c = _e140; - let _e141 = coord_1; - let _e149 = coord_1; - let _e153 = vec4(_e149, 0f, 0f, 6f); - let _e162 = textureSampleGrad(tex1D, samp, (_e153.xyz / vec3(_e153.w)).x, 4f, 4f, 5i); + let _e60 = vec4(_e56, 0f, 0f, 6f); + let _e66 = textureSample(tex1D, samp, (_e60.xyz / vec3(_e60.w)).x); + c = _e66; + let _e67 = coord_1; + let _e69 = vec2(_e67, 6f); + let _e75 = textureSampleGrad(tex1D, samp, (_e69.x / _e69.y), 4f, 4f); + c = _e75; + let _e76 = coord_1; + let _e80 = vec4(_e76, 0f, 0f, 6f); + let _e88 = textureSampleGrad(tex1D, samp, (_e80.xyz / vec3(_e80.w)).x, 4f, 4f); + c = _e88; + let _e89 = coord_1; + let _e91 = vec2(_e89, 6f); + let _e98 = textureSampleGrad(tex1D, samp, (_e91.x / _e91.y), 4f, 4f, 5i); + c = _e98; + let _e99 = coord_1; + let _e103 = vec4(_e99, 0f, 0f, 6f); + let _e112 = textureSampleGrad(tex1D, samp, (_e103.xyz / vec3(_e103.w)).x, 4f, 4f, 5i); + c = _e112; + let _e113 = coord_1; + let _e115 = vec2(_e113, 6f); + let _e120 = textureSampleLevel(tex1D, samp, (_e115.x / _e115.y), 3f); + c = _e120; + let _e121 = coord_1; + let _e125 = vec4(_e121, 0f, 0f, 6f); + let _e132 = textureSampleLevel(tex1D, samp, (_e125.xyz / vec3(_e125.w)).x, 3f); + c = _e132; + let _e133 = coord_1; + let _e135 = vec2(_e133, 6f); + let _e141 = textureSampleLevel(tex1D, samp, (_e135.x / _e135.y), 3f, 5i); + c = _e141; + let _e142 = coord_1; + let _e146 = vec4(_e142, 0f, 0f, 6f); + let _e154 = textureSampleLevel(tex1D, samp, (_e146.xyz / vec3(_e146.w)).x, 3f, 5i); + c = _e154; + let _e155 = coord_1; + let _e157 = vec2(_e155, 6f); + let _e162 = textureSample(tex1D, samp, (_e157.x / _e157.y), 5i); c = _e162; let _e163 = coord_1; - let _e167 = coord_1; - let _e169 = vec2(_e167, 6f); - let _e174 = textureSampleLevel(tex1D, samp, (_e169.x / _e169.y), 3f); + let _e167 = vec4(_e163, 0f, 0f, 6f); + let _e174 = textureSample(tex1D, samp, (_e167.xyz / vec3(_e167.w)).x, 5i); c = _e174; let _e175 = coord_1; - let _e181 = coord_1; - let _e185 = vec4(_e181, 0f, 0f, 6f); - let _e192 = textureSampleLevel(tex1D, samp, (_e185.xyz / vec3(_e185.w)).x, 3f); - c = _e192; - let _e193 = coord_1; - let _e198 = coord_1; - let _e200 = vec2(_e198, 6f); - let _e206 = textureSampleLevel(tex1D, samp, (_e200.x / _e200.y), 3f, 5i); - c = _e206; - let _e207 = coord_1; - let _e214 = coord_1; - let _e218 = vec4(_e214, 0f, 0f, 6f); - let _e226 = textureSampleLevel(tex1D, samp, (_e218.xyz / vec3(_e218.w)).x, 3f, 5i); - c = _e226; - let _e227 = coord_1; - let _e231 = coord_1; - let _e233 = vec2(_e231, 6f); - let _e238 = textureSample(tex1D, samp, (_e233.x / _e233.y), 5i); - c = _e238; - let _e239 = coord_1; - let _e245 = coord_1; - let _e249 = vec4(_e245, 0f, 0f, 6f); - let _e256 = textureSample(tex1D, samp, (_e249.xyz / vec3(_e249.w)).x, 5i); - c = _e256; - let _e257 = coord_1; - let _e260 = coord_1; - let _e263 = textureLoad(tex1D, i32(_e260), 3i); - c = _e263; - let _e264 = coord_1; - let _e268 = coord_1; - let _e272 = textureLoad(tex1D, i32(_e268), 3i); - c = _e272; + let _e178 = textureLoad(tex1D, i32(_e175), 3i); + c = _e178; + let _e179 = coord_1; + let _e183 = textureLoad(tex1D, i32(_e179), 3i); + c = _e183; return; } @@ -142,39 +128,37 @@ fn testTex1DArray(coord_2: vec2) { var c_1: vec4; coord_3 = coord_2; - let _e22 = textureDimensions(tex1DArray, 0i); - let _e23 = textureNumLayers(tex1DArray); - size1DArray = vec2(vec2(_e22, _e23)); - let _e27 = textureNumLevels(tex1DArray); - levels_1 = i32(_e27); - let _e32 = coord_3; - let _e36 = textureSample(tex1DArray, samp, _e32.x, i32(_e32.y)); - c_1 = _e36; - let _e40 = coord_3; - let _e46 = textureSampleGrad(tex1DArray, samp, _e40.x, i32(_e40.y), 4f, 4f); - c_1 = _e46; - let _e51 = coord_3; - let _e58 = textureSampleGrad(tex1DArray, samp, _e51.x, i32(_e51.y), 4f, 4f, 5i); - c_1 = _e58; - let _e61 = coord_3; - let _e66 = textureSampleLevel(tex1DArray, samp, _e61.x, i32(_e61.y), 3f); - c_1 = _e66; - let _e70 = coord_3; - let _e76 = textureSampleLevel(tex1DArray, samp, _e70.x, i32(_e70.y), 3f, 5i); - c_1 = _e76; - let _e79 = coord_3; - let _e84 = textureSample(tex1DArray, samp, _e79.x, i32(_e79.y), 5i); - c_1 = _e84; - let _e85 = coord_3; - let _e88 = coord_3; - let _e89 = vec2(_e88); - let _e93 = textureLoad(tex1DArray, _e89.x, _e89.y, 3i); - c_1 = _e93; - let _e94 = coord_3; - let _e98 = coord_3; - let _e99 = vec2(_e98); - let _e104 = textureLoad(tex1DArray, _e99.x, _e99.y, 3i); - c_1 = _e104; + let _e21 = textureDimensions(tex1DArray, 0i); + let _e22 = textureNumLayers(tex1DArray); + size1DArray = vec2(vec2(_e21, _e22)); + let _e26 = textureNumLevels(tex1DArray); + levels_1 = i32(_e26); + let _e30 = coord_3; + let _e34 = textureSample(tex1DArray, samp, _e30.x, i32(_e30.y)); + c_1 = _e34; + let _e35 = coord_3; + let _e41 = textureSampleGrad(tex1DArray, samp, _e35.x, i32(_e35.y), 4f, 4f); + c_1 = _e41; + let _e42 = coord_3; + let _e49 = textureSampleGrad(tex1DArray, samp, _e42.x, i32(_e42.y), 4f, 4f, 5i); + c_1 = _e49; + let _e50 = coord_3; + let _e55 = textureSampleLevel(tex1DArray, samp, _e50.x, i32(_e50.y), 3f); + c_1 = _e55; + let _e56 = coord_3; + let _e62 = textureSampleLevel(tex1DArray, samp, _e56.x, i32(_e56.y), 3f, 5i); + c_1 = _e62; + let _e63 = coord_3; + let _e68 = textureSample(tex1DArray, samp, _e63.x, i32(_e63.y), 5i); + c_1 = _e68; + let _e69 = coord_3; + let _e70 = vec2(_e69); + let _e74 = textureLoad(tex1DArray, _e70.x, _e70.y, 3i); + c_1 = _e74; + let _e75 = coord_3; + let _e76 = vec2(_e75); + let _e81 = textureLoad(tex1DArray, _e76.x, _e76.y, 3i); + c_1 = _e81; return; } @@ -185,138 +169,116 @@ fn testTex2D(coord_4: vec2) { var c_2: vec4; coord_5 = coord_4; - let _e22 = textureDimensions(tex2D, 0i); - size2D = vec2(_e22); - let _e25 = textureNumLevels(tex2D); - levels_2 = i32(_e25); + let _e21 = textureDimensions(tex2D, 0i); + size2D = vec2(_e21); + let _e24 = textureNumLevels(tex2D); + levels_2 = i32(_e24); + let _e28 = coord_5; + let _e29 = textureSample(tex2D, samp, _e28); + c_2 = _e29; let _e30 = coord_5; - let _e31 = textureSample(tex2D, samp, _e30); - c_2 = _e31; - let _e34 = coord_5; - let _e36 = textureSampleBias(tex2D, samp, _e34, 2f); - c_2 = _e36; - let _e42 = coord_5; - let _e47 = textureSampleGrad(tex2D, samp, _e42, vec2(4f), vec2(4f)); - c_2 = _e47; + let _e32 = textureSampleBias(tex2D, samp, _e30, 2f); + c_2 = _e32; + let _e33 = coord_5; + let _e38 = textureSampleGrad(tex2D, samp, _e33, vec2(4f), vec2(4f)); + c_2 = _e38; + let _e39 = coord_5; + let _e46 = textureSampleGrad(tex2D, samp, _e39, vec2(4f), vec2(4f), vec2(5i)); + c_2 = _e46; + let _e47 = coord_5; + let _e49 = textureSampleLevel(tex2D, samp, _e47, 3f); + c_2 = _e49; + let _e50 = coord_5; + let _e54 = textureSampleLevel(tex2D, samp, _e50, 3f, vec2(5i)); + c_2 = _e54; let _e55 = coord_5; - let _e62 = textureSampleGrad(tex2D, samp, _e55, vec2(4f), vec2(4f), vec2(5i)); - c_2 = _e62; - let _e65 = coord_5; - let _e67 = textureSampleLevel(tex2D, samp, _e65, 3f); - c_2 = _e67; - let _e72 = coord_5; - let _e76 = textureSampleLevel(tex2D, samp, _e72, 3f, vec2(5i)); - c_2 = _e76; - let _e80 = coord_5; - let _e83 = textureSample(tex2D, samp, _e80, vec2(5i)); - c_2 = _e83; - let _e88 = coord_5; - let _e92 = textureSampleBias(tex2D, samp, _e88, 2f, vec2(5i)); - c_2 = _e92; - let _e93 = coord_5; - let _e98 = coord_5; - let _e102 = vec3(_e98.x, _e98.y, 6f); - let _e107 = textureSample(tex2D, samp, (_e102.xy / vec2(_e102.z))); - c_2 = _e107; - let _e108 = coord_5; - let _e114 = coord_5; - let _e119 = vec4(_e114.x, _e114.y, 0f, 6f); - let _e125 = textureSample(tex2D, samp, (_e119.xyz / vec3(_e119.w)).xy); - c_2 = _e125; - let _e126 = coord_5; - let _e132 = coord_5; - let _e136 = vec3(_e132.x, _e132.y, 6f); - let _e142 = textureSampleBias(tex2D, samp, (_e136.xy / vec2(_e136.z)), 2f); - c_2 = _e142; - let _e143 = coord_5; - let _e150 = coord_5; - let _e155 = vec4(_e150.x, _e150.y, 0f, 6f); - let _e162 = textureSampleBias(tex2D, samp, (_e155.xyz / vec3(_e155.w)).xy, 2f); - c_2 = _e162; - let _e163 = coord_5; - let _e172 = coord_5; - let _e176 = vec3(_e172.x, _e172.y, 6f); - let _e185 = textureSampleGrad(tex2D, samp, (_e176.xy / vec2(_e176.z)), vec2(4f), vec2(4f)); - c_2 = _e185; - let _e186 = coord_5; - let _e196 = coord_5; - let _e201 = vec4(_e196.x, _e196.y, 0f, 6f); - let _e211 = textureSampleGrad(tex2D, samp, (_e201.xyz / vec3(_e201.w)).xy, vec2(4f), vec2(4f)); - c_2 = _e211; - let _e212 = coord_5; - let _e223 = coord_5; - let _e227 = vec3(_e223.x, _e223.y, 6f); - let _e238 = textureSampleGrad(tex2D, samp, (_e227.xy / vec2(_e227.z)), vec2(4f), vec2(4f), vec2(5i)); - c_2 = _e238; - let _e239 = coord_5; - let _e251 = coord_5; - let _e256 = vec4(_e251.x, _e251.y, 0f, 6f); - let _e268 = textureSampleGrad(tex2D, samp, (_e256.xyz / vec3(_e256.w)).xy, vec2(4f), vec2(4f), vec2(5i)); - c_2 = _e268; - let _e269 = coord_5; - let _e275 = coord_5; - let _e279 = vec3(_e275.x, _e275.y, 6f); - let _e285 = textureSampleLevel(tex2D, samp, (_e279.xy / vec2(_e279.z)), 3f); - c_2 = _e285; - let _e286 = coord_5; - let _e293 = coord_5; - let _e298 = vec4(_e293.x, _e293.y, 0f, 6f); - let _e305 = textureSampleLevel(tex2D, samp, (_e298.xyz / vec3(_e298.w)).xy, 3f); - c_2 = _e305; - let _e306 = coord_5; - let _e314 = coord_5; - let _e318 = vec3(_e314.x, _e314.y, 6f); - let _e326 = textureSampleLevel(tex2D, samp, (_e318.xy / vec2(_e318.z)), 3f, vec2(5i)); - c_2 = _e326; - let _e327 = coord_5; - let _e336 = coord_5; - let _e341 = vec4(_e336.x, _e336.y, 0f, 6f); - let _e350 = textureSampleLevel(tex2D, samp, (_e341.xyz / vec3(_e341.w)).xy, 3f, vec2(5i)); - c_2 = _e350; - let _e351 = coord_5; - let _e358 = coord_5; - let _e362 = vec3(_e358.x, _e358.y, 6f); - let _e369 = textureSample(tex2D, samp, (_e362.xy / vec2(_e362.z)), vec2(5i)); - c_2 = _e369; - let _e370 = coord_5; - let _e378 = coord_5; - let _e383 = vec4(_e378.x, _e378.y, 0f, 6f); - let _e391 = textureSample(tex2D, samp, (_e383.xyz / vec3(_e383.w)).xy, vec2(5i)); - c_2 = _e391; - let _e392 = coord_5; - let _e400 = coord_5; - let _e404 = vec3(_e400.x, _e400.y, 6f); - let _e412 = textureSampleBias(tex2D, samp, (_e404.xy / vec2(_e404.z)), 2f, vec2(5i)); - c_2 = _e412; - let _e413 = coord_5; - let _e422 = coord_5; - let _e427 = vec4(_e422.x, _e422.y, 0f, 6f); - let _e436 = textureSampleBias(tex2D, samp, (_e427.xyz / vec3(_e427.w)).xy, 2f, vec2(5i)); - c_2 = _e436; - let _e437 = coord_5; - let _e440 = coord_5; - let _e443 = textureLoad(tex2D, vec2(_e440), 3i); - c_2 = _e443; - let _e444 = coord_5; - let _e447 = coord_5; - let _e450 = textureLoad(utex2D, vec2(_e447), 3i); - c_2 = vec4(_e450); - let _e452 = coord_5; - let _e455 = coord_5; - let _e458 = textureLoad(itex2D, vec2(_e455), 3i); - c_2 = vec4(_e458); - let _e460 = coord_5; - let _e465 = coord_5; - let _e470 = textureLoad(tex2D, vec2(_e465), 3i); - c_2 = _e470; - let _e471 = coord_5; - let _e476 = coord_5; - let _e481 = textureLoad(utex2D, vec2(_e476), 3i); - c_2 = vec4(_e481); - let _e483 = coord_5; - let _e488 = coord_5; - let _e493 = textureLoad(itex2D, vec2(_e488), 3i); - c_2 = vec4(_e493); + let _e58 = textureSample(tex2D, samp, _e55, vec2(5i)); + c_2 = _e58; + let _e59 = coord_5; + let _e63 = textureSampleBias(tex2D, samp, _e59, 2f, vec2(5i)); + c_2 = _e63; + let _e64 = coord_5; + let _e68 = vec3(_e64.x, _e64.y, 6f); + let _e73 = textureSample(tex2D, samp, (_e68.xy / vec2(_e68.z))); + c_2 = _e73; + let _e74 = coord_5; + let _e79 = vec4(_e74.x, _e74.y, 0f, 6f); + let _e85 = textureSample(tex2D, samp, (_e79.xyz / vec3(_e79.w)).xy); + c_2 = _e85; + let _e86 = coord_5; + let _e90 = vec3(_e86.x, _e86.y, 6f); + let _e96 = textureSampleBias(tex2D, samp, (_e90.xy / vec2(_e90.z)), 2f); + c_2 = _e96; + let _e97 = coord_5; + let _e102 = vec4(_e97.x, _e97.y, 0f, 6f); + let _e109 = textureSampleBias(tex2D, samp, (_e102.xyz / vec3(_e102.w)).xy, 2f); + c_2 = _e109; + let _e110 = coord_5; + let _e114 = vec3(_e110.x, _e110.y, 6f); + let _e123 = textureSampleGrad(tex2D, samp, (_e114.xy / vec2(_e114.z)), vec2(4f), vec2(4f)); + c_2 = _e123; + let _e124 = coord_5; + let _e129 = vec4(_e124.x, _e124.y, 0f, 6f); + let _e139 = textureSampleGrad(tex2D, samp, (_e129.xyz / vec3(_e129.w)).xy, vec2(4f), vec2(4f)); + c_2 = _e139; + let _e140 = coord_5; + let _e144 = vec3(_e140.x, _e140.y, 6f); + let _e155 = textureSampleGrad(tex2D, samp, (_e144.xy / vec2(_e144.z)), vec2(4f), vec2(4f), vec2(5i)); + c_2 = _e155; + let _e156 = coord_5; + let _e161 = vec4(_e156.x, _e156.y, 0f, 6f); + let _e173 = textureSampleGrad(tex2D, samp, (_e161.xyz / vec3(_e161.w)).xy, vec2(4f), vec2(4f), vec2(5i)); + c_2 = _e173; + let _e174 = coord_5; + let _e178 = vec3(_e174.x, _e174.y, 6f); + let _e184 = textureSampleLevel(tex2D, samp, (_e178.xy / vec2(_e178.z)), 3f); + c_2 = _e184; + let _e185 = coord_5; + let _e190 = vec4(_e185.x, _e185.y, 0f, 6f); + let _e197 = textureSampleLevel(tex2D, samp, (_e190.xyz / vec3(_e190.w)).xy, 3f); + c_2 = _e197; + let _e198 = coord_5; + let _e202 = vec3(_e198.x, _e198.y, 6f); + let _e210 = textureSampleLevel(tex2D, samp, (_e202.xy / vec2(_e202.z)), 3f, vec2(5i)); + c_2 = _e210; + let _e211 = coord_5; + let _e216 = vec4(_e211.x, _e211.y, 0f, 6f); + let _e225 = textureSampleLevel(tex2D, samp, (_e216.xyz / vec3(_e216.w)).xy, 3f, vec2(5i)); + c_2 = _e225; + let _e226 = coord_5; + let _e230 = vec3(_e226.x, _e226.y, 6f); + let _e237 = textureSample(tex2D, samp, (_e230.xy / vec2(_e230.z)), vec2(5i)); + c_2 = _e237; + let _e238 = coord_5; + let _e243 = vec4(_e238.x, _e238.y, 0f, 6f); + let _e251 = textureSample(tex2D, samp, (_e243.xyz / vec3(_e243.w)).xy, vec2(5i)); + c_2 = _e251; + let _e252 = coord_5; + let _e256 = vec3(_e252.x, _e252.y, 6f); + let _e264 = textureSampleBias(tex2D, samp, (_e256.xy / vec2(_e256.z)), 2f, vec2(5i)); + c_2 = _e264; + let _e265 = coord_5; + let _e270 = vec4(_e265.x, _e265.y, 0f, 6f); + let _e279 = textureSampleBias(tex2D, samp, (_e270.xyz / vec3(_e270.w)).xy, 2f, vec2(5i)); + c_2 = _e279; + let _e280 = coord_5; + let _e283 = textureLoad(tex2D, vec2(_e280), 3i); + c_2 = _e283; + let _e284 = coord_5; + let _e287 = textureLoad(utex2D, vec2(_e284), 3i); + c_2 = vec4(_e287); + let _e289 = coord_5; + let _e292 = textureLoad(itex2D, vec2(_e289), 3i); + c_2 = vec4(_e292); + let _e294 = coord_5; + let _e299 = textureLoad(tex2D, vec2(_e294), 3i); + c_2 = _e299; + let _e300 = coord_5; + let _e305 = textureLoad(utex2D, vec2(_e300), 3i); + c_2 = vec4(_e305); + let _e307 = coord_5; + let _e312 = textureLoad(itex2D, vec2(_e307), 3i); + c_2 = vec4(_e312); return; } @@ -327,76 +289,64 @@ fn testTex2DShadow(coord_6: vec2) { var d: f32; coord_7 = coord_6; - let _e22 = textureDimensions(tex2DShadow, 0i); - size2DShadow = vec2(_e22); - let _e25 = textureNumLevels(tex2DShadow); - levels_3 = i32(_e25); - let _e29 = coord_7; - let _e34 = coord_7; - let _e38 = vec3(_e34.x, _e34.y, 1f); - let _e41 = textureSampleCompare(tex2DShadow, sampShadow, _e38.xy, _e38.z); - d = _e41; - let _e42 = coord_7; - let _e51 = coord_7; - let _e55 = vec3(_e51.x, _e51.y, 1f); - let _e62 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e55.xy, _e55.z); - d = _e62; - let _e63 = coord_7; - let _e74 = coord_7; - let _e78 = vec3(_e74.x, _e74.y, 1f); - let _e87 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e78.xy, _e78.z, vec2(5i)); - d = _e87; - let _e88 = coord_7; - let _e94 = coord_7; - let _e98 = vec3(_e94.x, _e94.y, 1f); - let _e102 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e98.xy, _e98.z); - d = _e102; - let _e103 = coord_7; - let _e111 = coord_7; - let _e115 = vec3(_e111.x, _e111.y, 1f); - let _e121 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e115.xy, _e115.z, vec2(5i)); + let _e21 = textureDimensions(tex2DShadow, 0i); + size2DShadow = vec2(_e21); + let _e24 = textureNumLevels(tex2DShadow); + levels_3 = i32(_e24); + let _e28 = coord_7; + let _e32 = vec3(_e28.x, _e28.y, 1f); + let _e35 = textureSampleCompare(tex2DShadow, sampShadow, _e32.xy, _e32.z); + d = _e35; + let _e36 = coord_7; + let _e40 = vec3(_e36.x, _e36.y, 1f); + let _e47 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e40.xy, _e40.z); + d = _e47; + let _e48 = coord_7; + let _e52 = vec3(_e48.x, _e48.y, 1f); + let _e61 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e52.xy, _e52.z, vec2(5i)); + d = _e61; + let _e62 = coord_7; + let _e66 = vec3(_e62.x, _e62.y, 1f); + let _e70 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e66.xy, _e66.z); + d = _e70; + let _e71 = coord_7; + let _e75 = vec3(_e71.x, _e71.y, 1f); + let _e81 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e75.xy, _e75.z, vec2(5i)); + d = _e81; + let _e82 = coord_7; + let _e86 = vec3(_e82.x, _e82.y, 1f); + let _e91 = textureSampleCompare(tex2DShadow, sampShadow, _e86.xy, _e86.z, vec2(5i)); + d = _e91; + let _e92 = coord_7; + let _e97 = vec4(_e92.x, _e92.y, 1f, 6f); + let _e101 = (_e97.xyz / vec3(_e97.w)); + let _e104 = textureSampleCompare(tex2DShadow, sampShadow, _e101.xy, _e101.z); + d = _e104; + let _e105 = coord_7; + let _e110 = vec4(_e105.x, _e105.y, 1f, 6f); + let _e118 = (_e110.xyz / vec3(_e110.w)); + let _e121 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e118.xy, _e118.z); d = _e121; let _e122 = coord_7; - let _e129 = coord_7; - let _e133 = vec3(_e129.x, _e129.y, 1f); - let _e138 = textureSampleCompare(tex2DShadow, sampShadow, _e133.xy, _e133.z, vec2(5i)); - d = _e138; - let _e139 = coord_7; - let _e145 = coord_7; - let _e150 = vec4(_e145.x, _e145.y, 1f, 6f); - let _e154 = (_e150.xyz / vec3(_e150.w)); - let _e157 = textureSampleCompare(tex2DShadow, sampShadow, _e154.xy, _e154.z); - d = _e157; - let _e158 = coord_7; - let _e168 = coord_7; - let _e173 = vec4(_e168.x, _e168.y, 1f, 6f); - let _e181 = (_e173.xyz / vec3(_e173.w)); - let _e184 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e181.xy, _e181.z); - d = _e184; - let _e185 = coord_7; - let _e197 = coord_7; - let _e202 = vec4(_e197.x, _e197.y, 1f, 6f); - let _e212 = (_e202.xyz / vec3(_e202.w)); - let _e215 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e212.xy, _e212.z, vec2(5i)); - d = _e215; - let _e216 = coord_7; - let _e223 = coord_7; - let _e228 = vec4(_e223.x, _e223.y, 1f, 6f); - let _e233 = (_e228.xyz / vec3(_e228.w)); - let _e236 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e233.xy, _e233.z); - d = _e236; - let _e237 = coord_7; - let _e246 = coord_7; - let _e251 = vec4(_e246.x, _e246.y, 1f, 6f); - let _e258 = (_e251.xyz / vec3(_e251.w)); - let _e261 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e258.xy, _e258.z, vec2(5i)); - d = _e261; - let _e262 = coord_7; - let _e270 = coord_7; - let _e275 = vec4(_e270.x, _e270.y, 1f, 6f); - let _e281 = (_e275.xyz / vec3(_e275.w)); - let _e284 = textureSampleCompare(tex2DShadow, sampShadow, _e281.xy, _e281.z, vec2(5i)); - d = _e284; + let _e127 = vec4(_e122.x, _e122.y, 1f, 6f); + let _e137 = (_e127.xyz / vec3(_e127.w)); + let _e140 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e137.xy, _e137.z, vec2(5i)); + d = _e140; + let _e141 = coord_7; + let _e146 = vec4(_e141.x, _e141.y, 1f, 6f); + let _e151 = (_e146.xyz / vec3(_e146.w)); + let _e154 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e151.xy, _e151.z); + d = _e154; + let _e155 = coord_7; + let _e160 = vec4(_e155.x, _e155.y, 1f, 6f); + let _e167 = (_e160.xyz / vec3(_e160.w)); + let _e170 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e167.xy, _e167.z, vec2(5i)); + d = _e170; + let _e171 = coord_7; + let _e176 = vec4(_e171.x, _e171.y, 1f, 6f); + let _e182 = (_e176.xyz / vec3(_e176.w)); + let _e185 = textureSampleCompare(tex2DShadow, sampShadow, _e182.xy, _e182.z, vec2(5i)); + d = _e185; return; } @@ -407,45 +357,43 @@ fn testTex2DArray(coord_8: vec3) { var c_3: vec4; coord_9 = coord_8; - let _e22 = textureDimensions(tex2DArray, 0i); - let _e25 = textureNumLayers(tex2DArray); - size2DArray = vec3(vec3(_e22.x, _e22.y, _e25)); - let _e29 = textureNumLevels(tex2DArray); - levels_4 = i32(_e29); - let _e34 = coord_9; - let _e38 = textureSample(tex2DArray, samp, _e34.xy, i32(_e34.z)); - c_3 = _e38; - let _e41 = coord_9; - let _e46 = textureSampleBias(tex2DArray, samp, _e41.xy, i32(_e41.z), 2f); - c_3 = _e46; + let _e21 = textureDimensions(tex2DArray, 0i); + let _e24 = textureNumLayers(tex2DArray); + size2DArray = vec3(vec3(_e21.x, _e21.y, _e24)); + let _e28 = textureNumLevels(tex2DArray); + levels_4 = i32(_e28); + let _e32 = coord_9; + let _e36 = textureSample(tex2DArray, samp, _e32.xy, i32(_e32.z)); + c_3 = _e36; + let _e37 = coord_9; + let _e42 = textureSampleBias(tex2DArray, samp, _e37.xy, i32(_e37.z), 2f); + c_3 = _e42; + let _e43 = coord_9; + let _e51 = textureSampleGrad(tex2DArray, samp, _e43.xy, i32(_e43.z), vec2(4f), vec2(4f)); + c_3 = _e51; let _e52 = coord_9; - let _e60 = textureSampleGrad(tex2DArray, samp, _e52.xy, i32(_e52.z), vec2(4f), vec2(4f)); - c_3 = _e60; - let _e68 = coord_9; - let _e78 = textureSampleGrad(tex2DArray, samp, _e68.xy, i32(_e68.z), vec2(4f), vec2(4f), vec2(5i)); - c_3 = _e78; - let _e81 = coord_9; - let _e86 = textureSampleLevel(tex2DArray, samp, _e81.xy, i32(_e81.z), 3f); - c_3 = _e86; - let _e91 = coord_9; - let _e98 = textureSampleLevel(tex2DArray, samp, _e91.xy, i32(_e91.z), 3f, vec2(5i)); - c_3 = _e98; - let _e102 = coord_9; - let _e108 = textureSample(tex2DArray, samp, _e102.xy, i32(_e102.z), vec2(5i)); - c_3 = _e108; - let _e113 = coord_9; - let _e120 = textureSampleBias(tex2DArray, samp, _e113.xy, i32(_e113.z), 2f, vec2(5i)); - c_3 = _e120; - let _e121 = coord_9; - let _e124 = coord_9; - let _e125 = vec3(_e124); - let _e129 = textureLoad(tex2DArray, _e125.xy, _e125.z, 3i); - c_3 = _e129; - let _e130 = coord_9; - let _e135 = coord_9; - let _e136 = vec3(_e135); - let _e142 = textureLoad(tex2DArray, _e136.xy, _e136.z, 3i); - c_3 = _e142; + let _e62 = textureSampleGrad(tex2DArray, samp, _e52.xy, i32(_e52.z), vec2(4f), vec2(4f), vec2(5i)); + c_3 = _e62; + let _e63 = coord_9; + let _e68 = textureSampleLevel(tex2DArray, samp, _e63.xy, i32(_e63.z), 3f); + c_3 = _e68; + let _e69 = coord_9; + let _e76 = textureSampleLevel(tex2DArray, samp, _e69.xy, i32(_e69.z), 3f, vec2(5i)); + c_3 = _e76; + let _e77 = coord_9; + let _e83 = textureSample(tex2DArray, samp, _e77.xy, i32(_e77.z), vec2(5i)); + c_3 = _e83; + let _e84 = coord_9; + let _e91 = textureSampleBias(tex2DArray, samp, _e84.xy, i32(_e84.z), 2f, vec2(5i)); + c_3 = _e91; + let _e92 = coord_9; + let _e93 = vec3(_e92); + let _e97 = textureLoad(tex2DArray, _e93.xy, _e93.z, 3i); + c_3 = _e97; + let _e98 = coord_9; + let _e99 = vec3(_e98); + let _e105 = textureLoad(tex2DArray, _e99.xy, _e99.z, 3i); + c_3 = _e105; return; } @@ -456,31 +404,27 @@ fn testTex2DArrayShadow(coord_10: vec3) { var d_1: f32; coord_11 = coord_10; - let _e22 = textureDimensions(tex2DArrayShadow, 0i); - let _e25 = textureNumLayers(tex2DArrayShadow); - size2DArrayShadow = vec3(vec3(_e22.x, _e22.y, _e25)); - let _e29 = textureNumLevels(tex2DArrayShadow); - levels_5 = i32(_e29); - let _e33 = coord_11; - let _e39 = coord_11; - let _e44 = vec4(_e39.x, _e39.y, _e39.z, 1f); - let _e49 = textureSampleCompare(tex2DArrayShadow, sampShadow, _e44.xy, i32(_e44.z), _e44.w); - d_1 = _e49; - let _e50 = coord_11; - let _e60 = coord_11; - let _e65 = vec4(_e60.x, _e60.y, _e60.z, 1f); - let _e74 = textureSampleCompareLevel(tex2DArrayShadow, sampShadow, _e65.xy, i32(_e65.z), _e65.w); + let _e21 = textureDimensions(tex2DArrayShadow, 0i); + let _e24 = textureNumLayers(tex2DArrayShadow); + size2DArrayShadow = vec3(vec3(_e21.x, _e21.y, _e24)); + let _e28 = textureNumLevels(tex2DArrayShadow); + levels_5 = i32(_e28); + let _e32 = coord_11; + let _e37 = vec4(_e32.x, _e32.y, _e32.z, 1f); + let _e42 = textureSampleCompare(tex2DArrayShadow, sampShadow, _e37.xy, i32(_e37.z), _e37.w); + d_1 = _e42; + let _e43 = coord_11; + let _e48 = vec4(_e43.x, _e43.y, _e43.z, 1f); + let _e57 = textureSampleCompareLevel(tex2DArrayShadow, sampShadow, _e48.xy, i32(_e48.z), _e48.w); + d_1 = _e57; + let _e58 = coord_11; + let _e63 = vec4(_e58.x, _e58.y, _e58.z, 1f); + let _e74 = textureSampleCompareLevel(tex2DArrayShadow, sampShadow, _e63.xy, i32(_e63.z), _e63.w, vec2(5i)); d_1 = _e74; let _e75 = coord_11; - let _e87 = coord_11; - let _e92 = vec4(_e87.x, _e87.y, _e87.z, 1f); - let _e103 = textureSampleCompareLevel(tex2DArrayShadow, sampShadow, _e92.xy, i32(_e92.z), _e92.w, vec2(5i)); - d_1 = _e103; - let _e104 = coord_11; - let _e112 = coord_11; - let _e117 = vec4(_e112.x, _e112.y, _e112.z, 1f); - let _e124 = textureSampleCompare(tex2DArrayShadow, sampShadow, _e117.xy, i32(_e117.z), _e117.w, vec2(5i)); - d_1 = _e124; + let _e80 = vec4(_e75.x, _e75.y, _e75.z, 1f); + let _e87 = textureSampleCompare(tex2DArrayShadow, sampShadow, _e80.xy, i32(_e80.z), _e80.w, vec2(5i)); + d_1 = _e87; return; } @@ -491,22 +435,22 @@ fn testTexCube(coord_12: vec3) { var c_4: vec4; coord_13 = coord_12; - let _e22 = textureDimensions(texCube, 0i); - sizeCube = vec2(_e22); - let _e25 = textureNumLevels(texCube); - levels_6 = i32(_e25); + let _e21 = textureDimensions(texCube, 0i); + sizeCube = vec2(_e21); + let _e24 = textureNumLevels(texCube); + levels_6 = i32(_e24); + let _e28 = coord_13; + let _e29 = textureSample(texCube, samp, _e28); + c_4 = _e29; let _e30 = coord_13; - let _e31 = textureSample(texCube, samp, _e30); - c_4 = _e31; - let _e34 = coord_13; - let _e36 = textureSampleBias(texCube, samp, _e34, 2f); - c_4 = _e36; - let _e42 = coord_13; - let _e47 = textureSampleGrad(texCube, samp, _e42, vec3(4f), vec3(4f)); - c_4 = _e47; - let _e50 = coord_13; - let _e52 = textureSampleLevel(texCube, samp, _e50, 3f); - c_4 = _e52; + let _e32 = textureSampleBias(texCube, samp, _e30, 2f); + c_4 = _e32; + let _e33 = coord_13; + let _e38 = textureSampleGrad(texCube, samp, _e33, vec3(4f), vec3(4f)); + c_4 = _e38; + let _e39 = coord_13; + let _e41 = textureSampleLevel(texCube, samp, _e39, 3f); + c_4 = _e41; return; } @@ -517,20 +461,18 @@ fn testTexCubeShadow(coord_14: vec3) { var d_2: f32; coord_15 = coord_14; - let _e22 = textureDimensions(texCubeShadow, 0i); - sizeCubeShadow = vec2(_e22); - let _e25 = textureNumLevels(texCubeShadow); - levels_7 = i32(_e25); - let _e29 = coord_15; - let _e35 = coord_15; - let _e40 = vec4(_e35.x, _e35.y, _e35.z, 1f); - let _e43 = textureSampleCompare(texCubeShadow, sampShadow, _e40.xyz, _e40.w); - d_2 = _e43; - let _e44 = coord_15; - let _e54 = coord_15; - let _e59 = vec4(_e54.x, _e54.y, _e54.z, 1f); - let _e66 = textureSampleCompareLevel(texCubeShadow, sampShadow, _e59.xyz, _e59.w); - d_2 = _e66; + let _e21 = textureDimensions(texCubeShadow, 0i); + sizeCubeShadow = vec2(_e21); + let _e24 = textureNumLevels(texCubeShadow); + levels_7 = i32(_e24); + let _e28 = coord_15; + let _e33 = vec4(_e28.x, _e28.y, _e28.z, 1f); + let _e36 = textureSampleCompare(texCubeShadow, sampShadow, _e33.xyz, _e33.w); + d_2 = _e36; + let _e37 = coord_15; + let _e42 = vec4(_e37.x, _e37.y, _e37.z, 1f); + let _e49 = textureSampleCompareLevel(texCubeShadow, sampShadow, _e42.xyz, _e42.w); + d_2 = _e49; return; } @@ -541,23 +483,23 @@ fn testTexCubeArray(coord_16: vec4) { var c_5: vec4; coord_17 = coord_16; - let _e22 = textureDimensions(texCubeArray, 0i); - let _e25 = textureNumLayers(texCubeArray); - sizeCubeArray = vec3(vec3(_e22.x, _e22.y, _e25)); - let _e29 = textureNumLevels(texCubeArray); - levels_8 = i32(_e29); - let _e34 = coord_17; - let _e38 = textureSample(texCubeArray, samp, _e34.xyz, i32(_e34.w)); - c_5 = _e38; - let _e41 = coord_17; - let _e46 = textureSampleBias(texCubeArray, samp, _e41.xyz, i32(_e41.w), 2f); - c_5 = _e46; + let _e21 = textureDimensions(texCubeArray, 0i); + let _e24 = textureNumLayers(texCubeArray); + sizeCubeArray = vec3(vec3(_e21.x, _e21.y, _e24)); + let _e28 = textureNumLevels(texCubeArray); + levels_8 = i32(_e28); + let _e32 = coord_17; + let _e36 = textureSample(texCubeArray, samp, _e32.xyz, i32(_e32.w)); + c_5 = _e36; + let _e37 = coord_17; + let _e42 = textureSampleBias(texCubeArray, samp, _e37.xyz, i32(_e37.w), 2f); + c_5 = _e42; + let _e43 = coord_17; + let _e51 = textureSampleGrad(texCubeArray, samp, _e43.xyz, i32(_e43.w), vec3(4f), vec3(4f)); + c_5 = _e51; let _e52 = coord_17; - let _e60 = textureSampleGrad(texCubeArray, samp, _e52.xyz, i32(_e52.w), vec3(4f), vec3(4f)); - c_5 = _e60; - let _e63 = coord_17; - let _e68 = textureSampleLevel(texCubeArray, samp, _e63.xyz, i32(_e63.w), 3f); - c_5 = _e68; + let _e57 = textureSampleLevel(texCubeArray, samp, _e52.xyz, i32(_e52.w), 3f); + c_5 = _e57; return; } @@ -568,14 +510,14 @@ fn testTexCubeArrayShadow(coord_18: vec4) { var d_3: f32; coord_19 = coord_18; - let _e22 = textureDimensions(texCubeArrayShadow, 0i); - let _e25 = textureNumLayers(texCubeArrayShadow); - sizeCubeArrayShadow = vec3(vec3(_e22.x, _e22.y, _e25)); - let _e29 = textureNumLevels(texCubeArrayShadow); - levels_9 = i32(_e29); - let _e35 = coord_19; - let _e40 = textureSampleCompare(texCubeArrayShadow, sampShadow, _e35.xyz, i32(_e35.w), 1f); - d_3 = _e40; + let _e21 = textureDimensions(texCubeArrayShadow, 0i); + let _e24 = textureNumLayers(texCubeArrayShadow); + sizeCubeArrayShadow = vec3(vec3(_e21.x, _e21.y, _e24)); + let _e28 = textureNumLevels(texCubeArrayShadow); + levels_9 = i32(_e28); + let _e32 = coord_19; + let _e37 = textureSampleCompare(texCubeArrayShadow, sampShadow, _e32.xyz, i32(_e32.w), 1f); + d_3 = _e37; return; } @@ -586,82 +528,72 @@ fn testTex3D(coord_20: vec3) { var c_6: vec4; coord_21 = coord_20; - let _e22 = textureDimensions(tex3D, 0i); - size3D = vec3(_e22); - let _e25 = textureNumLevels(tex3D); - levels_10 = i32(_e25); + let _e21 = textureDimensions(tex3D, 0i); + size3D = vec3(_e21); + let _e24 = textureNumLevels(tex3D); + levels_10 = i32(_e24); + let _e28 = coord_21; + let _e29 = textureSample(tex3D, samp, _e28); + c_6 = _e29; let _e30 = coord_21; - let _e31 = textureSample(tex3D, samp, _e30); - c_6 = _e31; - let _e34 = coord_21; - let _e36 = textureSampleBias(tex3D, samp, _e34, 2f); - c_6 = _e36; - let _e37 = coord_21; - let _e43 = coord_21; - let _e48 = vec4(_e43.x, _e43.y, _e43.z, 6f); - let _e53 = textureSample(tex3D, samp, (_e48.xyz / vec3(_e48.w))); - c_6 = _e53; - let _e54 = coord_21; - let _e61 = coord_21; - let _e66 = vec4(_e61.x, _e61.y, _e61.z, 6f); - let _e72 = textureSampleBias(tex3D, samp, (_e66.xyz / vec3(_e66.w)), 2f); - c_6 = _e72; - let _e73 = coord_21; - let _e81 = coord_21; - let _e86 = vec4(_e81.x, _e81.y, _e81.z, 6f); - let _e93 = textureSample(tex3D, samp, (_e86.xyz / vec3(_e86.w)), vec3(5i)); - c_6 = _e93; - let _e94 = coord_21; - let _e103 = coord_21; - let _e108 = vec4(_e103.x, _e103.y, _e103.z, 6f); - let _e116 = textureSampleBias(tex3D, samp, (_e108.xyz / vec3(_e108.w)), 2f, vec3(5i)); - c_6 = _e116; - let _e117 = coord_21; + let _e32 = textureSampleBias(tex3D, samp, _e30, 2f); + c_6 = _e32; + let _e33 = coord_21; + let _e38 = vec4(_e33.x, _e33.y, _e33.z, 6f); + let _e43 = textureSample(tex3D, samp, (_e38.xyz / vec3(_e38.w))); + c_6 = _e43; + let _e44 = coord_21; + let _e49 = vec4(_e44.x, _e44.y, _e44.z, 6f); + let _e55 = textureSampleBias(tex3D, samp, (_e49.xyz / vec3(_e49.w)), 2f); + c_6 = _e55; + let _e56 = coord_21; + let _e61 = vec4(_e56.x, _e56.y, _e56.z, 6f); + let _e68 = textureSample(tex3D, samp, (_e61.xyz / vec3(_e61.w)), vec3(5i)); + c_6 = _e68; + let _e69 = coord_21; + let _e74 = vec4(_e69.x, _e69.y, _e69.z, 6f); + let _e82 = textureSampleBias(tex3D, samp, (_e74.xyz / vec3(_e74.w)), 2f, vec3(5i)); + c_6 = _e82; + let _e83 = coord_21; + let _e88 = vec4(_e83.x, _e83.y, _e83.z, 6f); + let _e94 = textureSampleLevel(tex3D, samp, (_e88.xyz / vec3(_e88.w)), 3f); + c_6 = _e94; + let _e95 = coord_21; + let _e100 = vec4(_e95.x, _e95.y, _e95.z, 6f); + let _e108 = textureSampleLevel(tex3D, samp, (_e100.xyz / vec3(_e100.w)), 3f, vec3(5i)); + c_6 = _e108; + let _e109 = coord_21; + let _e114 = vec4(_e109.x, _e109.y, _e109.z, 6f); + let _e123 = textureSampleGrad(tex3D, samp, (_e114.xyz / vec3(_e114.w)), vec3(4f), vec3(4f)); + c_6 = _e123; let _e124 = coord_21; let _e129 = vec4(_e124.x, _e124.y, _e124.z, 6f); - let _e135 = textureSampleLevel(tex3D, samp, (_e129.xyz / vec3(_e129.w)), 3f); - c_6 = _e135; - let _e136 = coord_21; - let _e145 = coord_21; - let _e150 = vec4(_e145.x, _e145.y, _e145.z, 6f); - let _e158 = textureSampleLevel(tex3D, samp, (_e150.xyz / vec3(_e150.w)), 3f, vec3(5i)); - c_6 = _e158; - let _e159 = coord_21; - let _e169 = coord_21; - let _e174 = vec4(_e169.x, _e169.y, _e169.z, 6f); - let _e183 = textureSampleGrad(tex3D, samp, (_e174.xyz / vec3(_e174.w)), vec3(4f), vec3(4f)); - c_6 = _e183; - let _e184 = coord_21; - let _e196 = coord_21; - let _e201 = vec4(_e196.x, _e196.y, _e196.z, 6f); - let _e212 = textureSampleGrad(tex3D, samp, (_e201.xyz / vec3(_e201.w)), vec3(4f), vec3(4f), vec3(5i)); - c_6 = _e212; - let _e218 = coord_21; - let _e223 = textureSampleGrad(tex3D, samp, _e218, vec3(4f), vec3(4f)); - c_6 = _e223; - let _e231 = coord_21; - let _e238 = textureSampleGrad(tex3D, samp, _e231, vec3(4f), vec3(4f), vec3(5i)); - c_6 = _e238; - let _e241 = coord_21; - let _e243 = textureSampleLevel(tex3D, samp, _e241, 3f); - c_6 = _e243; - let _e248 = coord_21; - let _e252 = textureSampleLevel(tex3D, samp, _e248, 3f, vec3(5i)); - c_6 = _e252; - let _e256 = coord_21; - let _e259 = textureSample(tex3D, samp, _e256, vec3(5i)); - c_6 = _e259; - let _e264 = coord_21; - let _e268 = textureSampleBias(tex3D, samp, _e264, 2f, vec3(5i)); - c_6 = _e268; - let _e269 = coord_21; - let _e272 = coord_21; - let _e275 = textureLoad(tex3D, vec3(_e272), 3i); - c_6 = _e275; - let _e276 = coord_21; - let _e281 = coord_21; - let _e286 = textureLoad(tex3D, vec3(_e281), 3i); - c_6 = _e286; + let _e140 = textureSampleGrad(tex3D, samp, (_e129.xyz / vec3(_e129.w)), vec3(4f), vec3(4f), vec3(5i)); + c_6 = _e140; + let _e141 = coord_21; + let _e146 = textureSampleGrad(tex3D, samp, _e141, vec3(4f), vec3(4f)); + c_6 = _e146; + let _e147 = coord_21; + let _e154 = textureSampleGrad(tex3D, samp, _e147, vec3(4f), vec3(4f), vec3(5i)); + c_6 = _e154; + let _e155 = coord_21; + let _e157 = textureSampleLevel(tex3D, samp, _e155, 3f); + c_6 = _e157; + let _e158 = coord_21; + let _e162 = textureSampleLevel(tex3D, samp, _e158, 3f, vec3(5i)); + c_6 = _e162; + let _e163 = coord_21; + let _e166 = textureSample(tex3D, samp, _e163, vec3(5i)); + c_6 = _e166; + let _e167 = coord_21; + let _e171 = textureSampleBias(tex3D, samp, _e167, 2f, vec3(5i)); + c_6 = _e171; + let _e172 = coord_21; + let _e175 = textureLoad(tex3D, vec3(_e172), 3i); + c_6 = _e175; + let _e176 = coord_21; + let _e181 = textureLoad(tex3D, vec3(_e176), 3i); + c_6 = _e181; return; } @@ -674,9 +606,8 @@ fn testTex2DMS(coord_22: vec2) { let _e20 = textureDimensions(tex2DMS); size2DMS = vec2(_e20); let _e24 = coord_23; - let _e27 = coord_23; - let _e30 = textureLoad(tex2DMS, vec2(_e27), 3i); - c_7 = _e30; + let _e27 = textureLoad(tex2DMS, vec2(_e24), 3i); + c_7 = _e27; return; } @@ -690,10 +621,9 @@ fn testTex2DMSArray(coord_24: vec3) { let _e23 = textureNumLayers(tex2DMSArray); size2DMSArray = vec3(vec3(_e20.x, _e20.y, _e23)); let _e28 = coord_25; - let _e31 = coord_25; - let _e32 = vec3(_e31); - let _e36 = textureLoad(tex2DMSArray, _e32.xy, _e32.z, 3i); - c_8 = _e36; + let _e29 = vec3(_e28); + let _e33 = textureLoad(tex2DMSArray, _e29.xy, _e29.z, 3i); + c_8 = _e33; return; } diff --git a/naga/tests/out/wgsl/vector-functions.frag.wgsl b/naga/tests/out/wgsl/vector-functions.frag.wgsl index 90b35f3837..0f28a40c87 100644 --- a/naga/tests/out/wgsl/vector-functions.frag.wgsl +++ b/naga/tests/out/wgsl/vector-functions.frag.wgsl @@ -10,24 +10,24 @@ fn ftest(a: vec4, b: vec4) { a_1 = a; b_1 = b; - let _e6 = a_1; - let _e7 = b_1; - c = (_e6 < _e7); + let _e4 = a_1; + let _e5 = b_1; + c = (_e4 < _e5); + let _e8 = a_1; + let _e9 = b_1; + d = (_e8 <= _e9); let _e12 = a_1; let _e13 = b_1; - d = (_e12 <= _e13); - let _e18 = a_1; - let _e19 = b_1; - e = (_e18 > _e19); + e = (_e12 > _e13); + let _e16 = a_1; + let _e17 = b_1; + f = (_e16 >= _e17); + let _e20 = a_1; + let _e21 = b_1; + g = (_e20 == _e21); let _e24 = a_1; let _e25 = b_1; - f = (_e24 >= _e25); - let _e30 = a_1; - let _e31 = b_1; - g = (_e30 == _e31); - let _e36 = a_1; - let _e37 = b_1; - h = (_e36 != _e37); + h = (_e24 != _e25); return; } @@ -43,24 +43,24 @@ fn dtest(a_2: vec4, b_2: vec4) { a_3 = a_2; b_3 = b_2; - let _e6 = a_3; - let _e7 = b_3; - c_1 = (_e6 < _e7); + let _e4 = a_3; + let _e5 = b_3; + c_1 = (_e4 < _e5); + let _e8 = a_3; + let _e9 = b_3; + d_1 = (_e8 <= _e9); let _e12 = a_3; let _e13 = b_3; - d_1 = (_e12 <= _e13); - let _e18 = a_3; - let _e19 = b_3; - e_1 = (_e18 > _e19); + e_1 = (_e12 > _e13); + let _e16 = a_3; + let _e17 = b_3; + f_1 = (_e16 >= _e17); + let _e20 = a_3; + let _e21 = b_3; + g_1 = (_e20 == _e21); let _e24 = a_3; let _e25 = b_3; - f_1 = (_e24 >= _e25); - let _e30 = a_3; - let _e31 = b_3; - g_1 = (_e30 == _e31); - let _e36 = a_3; - let _e37 = b_3; - h_1 = (_e36 != _e37); + h_1 = (_e24 != _e25); return; } @@ -76,24 +76,24 @@ fn itest(a_4: vec4, b_4: vec4) { a_5 = a_4; b_5 = b_4; - let _e6 = a_5; - let _e7 = b_5; - c_2 = (_e6 < _e7); + let _e4 = a_5; + let _e5 = b_5; + c_2 = (_e4 < _e5); + let _e8 = a_5; + let _e9 = b_5; + d_2 = (_e8 <= _e9); let _e12 = a_5; let _e13 = b_5; - d_2 = (_e12 <= _e13); - let _e18 = a_5; - let _e19 = b_5; - e_2 = (_e18 > _e19); + e_2 = (_e12 > _e13); + let _e16 = a_5; + let _e17 = b_5; + f_2 = (_e16 >= _e17); + let _e20 = a_5; + let _e21 = b_5; + g_2 = (_e20 == _e21); let _e24 = a_5; let _e25 = b_5; - f_2 = (_e24 >= _e25); - let _e30 = a_5; - let _e31 = b_5; - g_2 = (_e30 == _e31); - let _e36 = a_5; - let _e37 = b_5; - h_2 = (_e36 != _e37); + h_2 = (_e24 != _e25); return; } @@ -109,24 +109,24 @@ fn utest(a_6: vec4, b_6: vec4) { a_7 = a_6; b_7 = b_6; - let _e6 = a_7; - let _e7 = b_7; - c_3 = (_e6 < _e7); + let _e4 = a_7; + let _e5 = b_7; + c_3 = (_e4 < _e5); + let _e8 = a_7; + let _e9 = b_7; + d_3 = (_e8 <= _e9); let _e12 = a_7; let _e13 = b_7; - d_3 = (_e12 <= _e13); - let _e18 = a_7; - let _e19 = b_7; - e_3 = (_e18 > _e19); + e_3 = (_e12 > _e13); + let _e16 = a_7; + let _e17 = b_7; + f_3 = (_e16 >= _e17); + let _e20 = a_7; + let _e21 = b_7; + g_3 = (_e20 == _e21); let _e24 = a_7; let _e25 = b_7; - f_3 = (_e24 >= _e25); - let _e30 = a_7; - let _e31 = b_7; - g_3 = (_e30 == _e31); - let _e36 = a_7; - let _e37 = b_7; - h_3 = (_e36 != _e37); + h_3 = (_e24 != _e25); return; } @@ -141,18 +141,18 @@ fn btest(a_8: vec4, b_8: vec4) { a_9 = a_8; b_9 = b_8; - let _e6 = a_9; - let _e7 = b_9; - c_4 = (_e6 == _e7); + let _e4 = a_9; + let _e5 = b_9; + c_4 = (_e4 == _e5); + let _e8 = a_9; + let _e9 = b_9; + d_4 = (_e8 != _e9); let _e12 = a_9; - let _e13 = b_9; - d_4 = (_e12 != _e13); - let _e17 = a_9; - e_4 = any(_e17); - let _e21 = a_9; - f_4 = all(_e21); - let _e25 = a_9; - g_4 = !(_e25); + e_4 = any(_e12); + let _e15 = a_9; + f_4 = all(_e15); + let _e18 = a_9; + g_4 = !(_e18); return; }