From 30189128978f6316ae5f8006f1dd4be049cd293a Mon Sep 17 00:00:00 2001 From: David Peicho Date: Fri, 15 Nov 2024 11:49:56 +0100 Subject: [PATCH] naga: Add support for GLSL signed/unsigned samplers (#6513) --- CHANGELOG.md | 3 +- naga/src/front/glsl/builtins.rs | 75 +- naga/tests/in/glsl/samplers.frag | 22 +- naga/tests/out/wgsl/samplers.frag.wgsl | 1118 ++++++++++++------------ 4 files changed, 638 insertions(+), 580 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 858247f2c..26e49d767 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -99,6 +99,7 @@ By @ErichDonGubler in [#6456](https://github.com/gfx-rs/wgpu/pull/6456), [#6148] - Fix an issue where `naga` CLI would incorrectly skip the first positional argument when `--stdin-file-path` was specified. By @ErichDonGubler in [#6480](https://github.com/gfx-rs/wgpu/pull/6480). - Fix textureNumLevels in the GLSL backend. By @magcius in [#6483](https://github.com/gfx-rs/wgpu/pull/6483). - Implement `quantizeToF16()` for WGSL frontend, and WGSL, SPIR-V, HLSL, MSL, and GLSL backends. By @jamienicol in [#6519](https://github.com/gfx-rs/wgpu/pull/6519). +- Add support for GLSL `usampler*` and `isampler*`. By @DavidPeicho in [#6513](https://github.com/gfx-rs/wgpu/pull/6513). #### General @@ -3481,4 +3482,4 @@ DeviceDescriptor { - concept of the storage hub - basic recording of passes and command buffers - submission-based lifetime tracking and command buffer recycling -- automatic resource transitions +- automatic resource transitions \ No newline at end of file diff --git a/naga/src/front/glsl/builtins.rs b/naga/src/front/glsl/builtins.rs index 2c11b9d62..94594f6cb 100644 --- a/naga/src/front/glsl/builtins.rs +++ b/naga/src/front/glsl/builtins.rs @@ -462,37 +462,54 @@ fn inject_standard_builtins( module: &mut Module, name: &str, ) { - match name { - "sampler1D" | "sampler1DArray" | "sampler2D" | "sampler2DArray" | "sampler2DMS" - | "sampler2DMSArray" | "sampler3D" | "samplerCube" | "samplerCubeArray" => { - declaration.overloads.push(module.add_builtin( - vec![ - TypeInner::Image { - dim: match name { - "sampler1D" | "sampler1DArray" => Dim::D1, - "sampler2D" | "sampler2DArray" | "sampler2DMS" | "sampler2DMSArray" => { - Dim::D2 - } - "sampler3D" => Dim::D3, - _ => Dim::Cube, + // Some samplers (sampler1D, etc...) can be float, int, or uint + let anykind_sampler = if name.starts_with("sampler") { + Some((name, Sk::Float)) + } else if name.starts_with("usampler") { + Some((&name[1..], Sk::Uint)) + } else if name.starts_with("isampler") { + Some((&name[1..], Sk::Sint)) + } else { + None + }; + if let Some((sampler, kind)) = anykind_sampler { + match sampler { + "sampler1D" | "sampler1DArray" | "sampler2D" | "sampler2DArray" | "sampler2DMS" + | "sampler2DMSArray" | "sampler3D" | "samplerCube" | "samplerCubeArray" => { + declaration.overloads.push(module.add_builtin( + vec![ + TypeInner::Image { + dim: match sampler { + "sampler1D" | "sampler1DArray" => Dim::D1, + "sampler2D" | "sampler2DArray" | "sampler2DMS" + | "sampler2DMSArray" => Dim::D2, + "sampler3D" => Dim::D3, + _ => Dim::Cube, + }, + arrayed: matches!( + sampler, + "sampler1DArray" + | "sampler2DArray" + | "sampler2DMSArray" + | "samplerCubeArray" + ), + class: ImageClass::Sampled { + kind, + multi: matches!(sampler, "sampler2DMS" | "sampler2DMSArray"), + }, }, - arrayed: matches!( - name, - "sampler1DArray" - | "sampler2DArray" - | "sampler2DMSArray" - | "samplerCubeArray" - ), - class: ImageClass::Sampled { - kind: Sk::Float, - multi: matches!(name, "sampler2DMS" | "sampler2DMSArray"), - }, - }, - TypeInner::Sampler { comparison: false }, - ], - MacroCall::Sampler, - )) + TypeInner::Sampler { comparison: false }, + ], + MacroCall::Sampler, + )); + return; + } + _ => (), } + } + + match name { + // Shadow sampler can only be of kind `Sk::Float` "sampler1DShadow" | "sampler1DArrayShadow" | "sampler2DShadow" diff --git a/naga/tests/in/glsl/samplers.frag b/naga/tests/in/glsl/samplers.frag index 25a4387fe..efb1c0ceb 100644 --- a/naga/tests/in/glsl/samplers.frag +++ b/naga/tests/in/glsl/samplers.frag @@ -8,7 +8,11 @@ layout(set = 1, binding = 3) uniform texture2DArray tex2DArray; layout(set = 1, binding = 4) uniform textureCube texCube; layout(set = 1, binding = 5) uniform textureCubeArray texCubeArray; layout(set = 1, binding = 6) uniform texture3D tex3D; -layout(set = 1, binding = 7) uniform sampler samp; + +layout(set = 1, binding = 7) uniform utexture2D utex2D; +layout(set = 1, binding = 8) uniform itexture2D itex2D; + +layout(set = 2, binding = 0) uniform sampler samp; // WGSL doesn't have 1D depth samplers. #define HAS_1D_DEPTH_TEXTURES 0 @@ -129,16 +133,26 @@ void testTex2D(in vec2 coord) { vec4 c; c = texture(sampler2D(tex2D, samp), coord); c = texture(sampler2D(tex2D, samp), coord, 2.0); + /* Signed/Unsigned samplers not supported in the WGSL specification with `textureSample()` */ + c = textureGrad(sampler2D(tex2D, samp), coord, vec2(4.0), vec2(4.0)); + /* Signed/Unsigned samplers not supported in the WGSL specification with `textureSampleGrad()` */ + c = textureGradOffset(sampler2D(tex2D, samp), coord, vec2(4.0), vec2(4.0), ivec2(5)); + /* Signed/Unsigned samplers not supported in the WGSL specification with `textureSampleGrad()` */ + c = textureLod(sampler2D(tex2D, samp), coord, 3.0); + /* Signed/Unsigned samplers not supported in the WGSL specification with `textureSampleLevel()` */ + c = textureLodOffset(sampler2D(tex2D, samp), coord, 3.0, ivec2(5)); c = textureOffset(sampler2D(tex2D, samp), coord, ivec2(5)); c = textureOffset(sampler2D(tex2D, samp), coord, ivec2(5), 2.0); + c = textureProj(sampler2D(tex2D, samp), vec3(coord, 6.0)); c = textureProj(sampler2D(tex2D, samp), vec4(coord, 0.0, 6.0)); c = textureProj(sampler2D(tex2D, samp), vec3(coord, 6.0), 2.0); c = textureProj(sampler2D(tex2D, samp), vec4(coord, 0.0, 6.0), 2.0); + c = textureProjGrad(sampler2D(tex2D, samp), vec3(coord, 6.0), vec2(4.0), vec2(4.0)); c = textureProjGrad(sampler2D(tex2D, samp), vec4(coord, 0.0, 6.0), vec2(4.0), vec2(4.0)); c = textureProjGradOffset(sampler2D(tex2D, samp), vec3(coord, 6.0), vec2(4.0), vec2(4.0), ivec2(5)); @@ -151,8 +165,14 @@ void testTex2D(in vec2 coord) { c = textureProjOffset(sampler2D(tex2D, samp), vec4(coord, 0.0, 6.0), ivec2(5)); c = textureProjOffset(sampler2D(tex2D, samp), vec3(coord, 6.0), ivec2(5), 2.0); c = textureProjOffset(sampler2D(tex2D, samp), vec4(coord, 0.0, 6.0), ivec2(5), 2.0); + c = texelFetch(sampler2D(tex2D, samp), ivec2(coord), 3); + c = vec4(texelFetch(usampler2D(utex2D, samp), ivec2(coord), 3)); + c = vec4(texelFetch(isampler2D(itex2D, samp), ivec2(coord), 3)); + c = texelFetchOffset(sampler2D(tex2D, samp), ivec2(coord), 3, ivec2(5)); + c = vec4(texelFetchOffset(usampler2D(utex2D, samp), ivec2(coord), 3, ivec2(5))); + c = vec4(texelFetchOffset(isampler2D(itex2D, samp), ivec2(coord), 3, ivec2(5))); } void testTex2DShadow(vec2 coord) { diff --git a/naga/tests/out/wgsl/samplers.frag.wgsl b/naga/tests/out/wgsl/samplers.frag.wgsl index 387ef43bd..1e7514804 100644 --- a/naga/tests/out/wgsl/samplers.frag.wgsl +++ b/naga/tests/out/wgsl/samplers.frag.wgsl @@ -13,6 +13,10 @@ var texCubeArray: texture_cube_array; @group(1) @binding(6) var tex3D: texture_3d; @group(1) @binding(7) +var utex2D: texture_2d; +@group(1) @binding(8) +var itex2D: texture_2d; +@group(2) @binding(0) var samp: sampler; @group(1) @binding(12) var tex2DShadow: texture_depth_2d; @@ -38,122 +42,122 @@ fn testTex1D(coord: f32) { var c: vec4; coord_1 = coord; - let _e20 = textureDimensions(tex1D, 0i); - size1D = i32(_e20); - let _e23 = textureNumLevels(tex1D); - levels = i32(_e23); - let _e28 = coord_1; - let _e29 = textureSample(tex1D, samp, _e28); - c = _e29; - let _e32 = coord_1; - let _e34 = textureSampleBias(tex1D, samp, _e32, 2f); - c = _e34; - let _e38 = coord_1; - let _e41 = textureSampleGrad(tex1D, samp, _e38, 4f, 4f); - c = _e41; - let _e46 = coord_1; - let _e50 = textureSampleGrad(tex1D, samp, _e46, 4f, 4f, 5i); - c = _e50; - let _e53 = coord_1; - let _e55 = textureSampleLevel(tex1D, samp, _e53, 3f); - c = _e55; - let _e59 = coord_1; - let _e62 = textureSampleLevel(tex1D, samp, _e59, 3f, 5i); - c = _e62; - let _e65 = coord_1; - let _e67 = textureSample(tex1D, samp, _e65, 5i); - c = _e67; - let _e71 = coord_1; - let _e74 = textureSampleBias(tex1D, samp, _e71, 2f, 5i); - c = _e74; - let _e75 = coord_1; - let _e78 = coord_1; - let _e80 = vec2(_e78, 6f); - let _e84 = textureSample(tex1D, samp, (_e80.x / _e80.y)); - c = _e84; - let _e85 = coord_1; - let _e90 = coord_1; - let _e94 = vec4(_e90, 0f, 0f, 6f); - let _e100 = textureSample(tex1D, samp, (_e94.xyz / vec3(_e94.w)).x); - c = _e100; - let _e101 = coord_1; - let _e105 = coord_1; - let _e107 = vec2(_e105, 6f); - let _e112 = textureSampleBias(tex1D, samp, (_e107.x / _e107.y), 2f); - c = _e112; - let _e113 = coord_1; - let _e119 = coord_1; - let _e123 = vec4(_e119, 0f, 0f, 6f); - let _e130 = textureSampleBias(tex1D, samp, (_e123.xyz / vec3(_e123.w)).x, 2f); - c = _e130; - let _e131 = coord_1; - let _e136 = coord_1; - let _e138 = vec2(_e136, 6f); - let _e144 = textureSampleGrad(tex1D, samp, (_e138.x / _e138.y), 4f, 4f); - c = _e144; - let _e145 = coord_1; - let _e152 = coord_1; - let _e156 = vec4(_e152, 0f, 0f, 6f); - let _e164 = textureSampleGrad(tex1D, samp, (_e156.xyz / vec3(_e156.w)).x, 4f, 4f); - c = _e164; - let _e165 = coord_1; - let _e171 = coord_1; - let _e173 = vec2(_e171, 6f); - let _e180 = textureSampleGrad(tex1D, samp, (_e173.x / _e173.y), 4f, 4f, 5i); - c = _e180; - let _e181 = coord_1; - let _e189 = coord_1; - let _e193 = vec4(_e189, 0f, 0f, 6f); - let _e202 = textureSampleGrad(tex1D, samp, (_e193.xyz / vec3(_e193.w)).x, 4f, 4f, 5i); - c = _e202; - let _e203 = coord_1; - let _e207 = coord_1; - let _e209 = vec2(_e207, 6f); - let _e214 = textureSampleLevel(tex1D, samp, (_e209.x / _e209.y), 3f); - c = _e214; - let _e215 = coord_1; - let _e221 = coord_1; - let _e225 = vec4(_e221, 0f, 0f, 6f); - let _e232 = textureSampleLevel(tex1D, samp, (_e225.xyz / vec3(_e225.w)).x, 3f); - c = _e232; - let _e233 = coord_1; - let _e238 = coord_1; - let _e240 = vec2(_e238, 6f); - let _e246 = textureSampleLevel(tex1D, samp, (_e240.x / _e240.y), 3f, 5i); - c = _e246; - let _e247 = coord_1; - let _e254 = coord_1; - let _e258 = vec4(_e254, 0f, 0f, 6f); - let _e266 = textureSampleLevel(tex1D, samp, (_e258.xyz / vec3(_e258.w)).x, 3f, 5i); - c = _e266; - let _e267 = coord_1; - let _e271 = coord_1; - let _e273 = vec2(_e271, 6f); - let _e278 = textureSample(tex1D, samp, (_e273.x / _e273.y), 5i); - c = _e278; - let _e279 = coord_1; - let _e285 = coord_1; - let _e289 = vec4(_e285, 0f, 0f, 6f); - let _e296 = textureSample(tex1D, samp, (_e289.xyz / vec3(_e289.w)).x, 5i); - c = _e296; - let _e297 = coord_1; - let _e302 = coord_1; - let _e304 = vec2(_e302, 6f); - let _e310 = textureSampleBias(tex1D, samp, (_e304.x / _e304.y), 2f, 5i); - c = _e310; - let _e311 = coord_1; - let _e318 = coord_1; - let _e322 = vec4(_e318, 0f, 0f, 6f); - let _e330 = textureSampleBias(tex1D, samp, (_e322.xyz / vec3(_e322.w)).x, 2f, 5i); - c = _e330; - let _e331 = coord_1; - let _e334 = coord_1; - let _e337 = textureLoad(tex1D, i32(_e334), 3i); - c = _e337; - let _e338 = coord_1; - let _e342 = coord_1; - let _e346 = textureLoad(tex1D, i32(_e342), 3i); - c = _e346; + let _e22 = textureDimensions(tex1D, 0i); + size1D = i32(_e22); + let _e25 = textureNumLevels(tex1D); + levels = i32(_e25); + let _e30 = coord_1; + let _e31 = textureSample(tex1D, samp, _e30); + c = _e31; + let _e34 = coord_1; + let _e36 = textureSampleBias(tex1D, samp, _e34, 2f); + c = _e36; + let _e40 = coord_1; + let _e43 = textureSampleGrad(tex1D, samp, _e40, 4f, 4f); + c = _e43; + let _e48 = coord_1; + let _e52 = textureSampleGrad(tex1D, samp, _e48, 4f, 4f, 5i); + c = _e52; + let _e55 = coord_1; + let _e57 = textureSampleLevel(tex1D, samp, _e55, 3f); + c = _e57; + let _e61 = coord_1; + let _e64 = textureSampleLevel(tex1D, samp, _e61, 3f, 5i); + c = _e64; + let _e67 = coord_1; + let _e69 = textureSample(tex1D, samp, _e67, 5i); + c = _e69; + let _e73 = coord_1; + let _e76 = textureSampleBias(tex1D, samp, _e73, 2f, 5i); + c = _e76; + let _e77 = coord_1; + let _e80 = coord_1; + let _e82 = vec2(_e80, 6f); + let _e86 = textureSample(tex1D, samp, (_e82.x / _e82.y)); + c = _e86; + let _e87 = coord_1; + let _e92 = coord_1; + let _e96 = vec4(_e92, 0f, 0f, 6f); + let _e102 = textureSample(tex1D, samp, (_e96.xyz / vec3(_e96.w)).x); + c = _e102; + let _e103 = coord_1; + let _e107 = coord_1; + let _e109 = vec2(_e107, 6f); + let _e114 = textureSampleBias(tex1D, samp, (_e109.x / _e109.y), 2f); + c = _e114; + let _e115 = coord_1; + let _e121 = coord_1; + let _e125 = vec4(_e121, 0f, 0f, 6f); + let _e132 = textureSampleBias(tex1D, samp, (_e125.xyz / vec3(_e125.w)).x, 2f); + c = _e132; + let _e133 = coord_1; + let _e138 = coord_1; + let _e140 = vec2(_e138, 6f); + let _e146 = textureSampleGrad(tex1D, samp, (_e140.x / _e140.y), 4f, 4f); + c = _e146; + let _e147 = coord_1; + let _e154 = coord_1; + let _e158 = vec4(_e154, 0f, 0f, 6f); + let _e166 = textureSampleGrad(tex1D, samp, (_e158.xyz / vec3(_e158.w)).x, 4f, 4f); + c = _e166; + let _e167 = coord_1; + let _e173 = coord_1; + let _e175 = vec2(_e173, 6f); + let _e182 = textureSampleGrad(tex1D, samp, (_e175.x / _e175.y), 4f, 4f, 5i); + c = _e182; + let _e183 = coord_1; + let _e191 = coord_1; + let _e195 = vec4(_e191, 0f, 0f, 6f); + let _e204 = textureSampleGrad(tex1D, samp, (_e195.xyz / vec3(_e195.w)).x, 4f, 4f, 5i); + c = _e204; + let _e205 = coord_1; + let _e209 = coord_1; + let _e211 = vec2(_e209, 6f); + let _e216 = textureSampleLevel(tex1D, samp, (_e211.x / _e211.y), 3f); + c = _e216; + let _e217 = coord_1; + let _e223 = coord_1; + let _e227 = vec4(_e223, 0f, 0f, 6f); + let _e234 = textureSampleLevel(tex1D, samp, (_e227.xyz / vec3(_e227.w)).x, 3f); + c = _e234; + let _e235 = coord_1; + let _e240 = coord_1; + let _e242 = vec2(_e240, 6f); + let _e248 = textureSampleLevel(tex1D, samp, (_e242.x / _e242.y), 3f, 5i); + c = _e248; + let _e249 = coord_1; + let _e256 = coord_1; + let _e260 = vec4(_e256, 0f, 0f, 6f); + let _e268 = textureSampleLevel(tex1D, samp, (_e260.xyz / vec3(_e260.w)).x, 3f, 5i); + c = _e268; + let _e269 = coord_1; + let _e273 = coord_1; + let _e275 = vec2(_e273, 6f); + let _e280 = textureSample(tex1D, samp, (_e275.x / _e275.y), 5i); + c = _e280; + let _e281 = coord_1; + let _e287 = coord_1; + let _e291 = vec4(_e287, 0f, 0f, 6f); + let _e298 = textureSample(tex1D, samp, (_e291.xyz / vec3(_e291.w)).x, 5i); + c = _e298; + let _e299 = coord_1; + let _e304 = coord_1; + let _e306 = vec2(_e304, 6f); + let _e312 = textureSampleBias(tex1D, samp, (_e306.x / _e306.y), 2f, 5i); + c = _e312; + let _e313 = coord_1; + let _e320 = coord_1; + let _e324 = vec4(_e320, 0f, 0f, 6f); + let _e332 = textureSampleBias(tex1D, samp, (_e324.xyz / vec3(_e324.w)).x, 2f, 5i); + c = _e332; + let _e333 = coord_1; + let _e336 = coord_1; + let _e339 = textureLoad(tex1D, i32(_e336), 3i); + c = _e339; + let _e340 = coord_1; + let _e344 = coord_1; + let _e348 = textureLoad(tex1D, i32(_e344), 3i); + c = _e348; return; } @@ -164,45 +168,45 @@ fn testTex1DArray(coord_2: vec2) { var c_1: vec4; coord_3 = coord_2; - let _e20 = textureDimensions(tex1DArray, 0i); - let _e21 = textureNumLayers(tex1DArray); - size1DArray = vec2(vec2(_e20, _e21)); - let _e25 = textureNumLevels(tex1DArray); - levels_1 = i32(_e25); - let _e30 = coord_3; - let _e34 = textureSample(tex1DArray, samp, _e30.x, i32(_e30.y)); - c_1 = _e34; - let _e37 = coord_3; - let _e42 = textureSampleBias(tex1DArray, samp, _e37.x, i32(_e37.y), 2f); - c_1 = _e42; - let _e46 = coord_3; - let _e52 = textureSampleGrad(tex1DArray, samp, _e46.x, i32(_e46.y), 4f, 4f); - c_1 = _e52; - let _e57 = coord_3; - let _e64 = textureSampleGrad(tex1DArray, samp, _e57.x, i32(_e57.y), 4f, 4f, 5i); - c_1 = _e64; - let _e67 = coord_3; - let _e72 = textureSampleLevel(tex1DArray, samp, _e67.x, i32(_e67.y), 3f); - c_1 = _e72; - let _e76 = coord_3; - let _e82 = textureSampleLevel(tex1DArray, samp, _e76.x, i32(_e76.y), 3f, 5i); - c_1 = _e82; - let _e85 = coord_3; - let _e90 = textureSample(tex1DArray, samp, _e85.x, i32(_e85.y), 5i); - c_1 = _e90; - let _e94 = coord_3; - let _e100 = textureSampleBias(tex1DArray, samp, _e94.x, i32(_e94.y), 2f, 5i); - c_1 = _e100; - let _e101 = coord_3; - let _e104 = coord_3; - let _e105 = vec2(_e104); - let _e109 = textureLoad(tex1DArray, _e105.x, _e105.y, 3i); - c_1 = _e109; - let _e110 = coord_3; - let _e114 = coord_3; - let _e115 = vec2(_e114); - let _e120 = textureLoad(tex1DArray, _e115.x, _e115.y, 3i); - c_1 = _e120; + 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 _e39 = coord_3; + let _e44 = textureSampleBias(tex1DArray, samp, _e39.x, i32(_e39.y), 2f); + c_1 = _e44; + let _e48 = coord_3; + let _e54 = textureSampleGrad(tex1DArray, samp, _e48.x, i32(_e48.y), 4f, 4f); + c_1 = _e54; + let _e59 = coord_3; + let _e66 = textureSampleGrad(tex1DArray, samp, _e59.x, i32(_e59.y), 4f, 4f, 5i); + c_1 = _e66; + let _e69 = coord_3; + let _e74 = textureSampleLevel(tex1DArray, samp, _e69.x, i32(_e69.y), 3f); + c_1 = _e74; + let _e78 = coord_3; + let _e84 = textureSampleLevel(tex1DArray, samp, _e78.x, i32(_e78.y), 3f, 5i); + c_1 = _e84; + let _e87 = coord_3; + let _e92 = textureSample(tex1DArray, samp, _e87.x, i32(_e87.y), 5i); + c_1 = _e92; + let _e96 = coord_3; + let _e102 = textureSampleBias(tex1DArray, samp, _e96.x, i32(_e96.y), 2f, 5i); + c_1 = _e102; + let _e103 = coord_3; + let _e106 = coord_3; + let _e107 = vec2(_e106); + let _e111 = textureLoad(tex1DArray, _e107.x, _e107.y, 3i); + c_1 = _e111; + let _e112 = coord_3; + let _e116 = coord_3; + let _e117 = vec2(_e116); + let _e122 = textureLoad(tex1DArray, _e117.x, _e117.y, 3i); + c_1 = _e122; return; } @@ -213,122 +217,138 @@ fn testTex2D(coord_4: vec2) { var c_2: vec4; coord_5 = coord_4; - let _e20 = textureDimensions(tex2D, 0i); - size2D = vec2(_e20); - let _e23 = textureNumLevels(tex2D); - levels_2 = i32(_e23); - let _e28 = coord_5; - let _e29 = textureSample(tex2D, samp, _e28); - c_2 = _e29; - let _e32 = coord_5; - let _e34 = textureSampleBias(tex2D, samp, _e32, 2f); - c_2 = _e34; - let _e40 = coord_5; - let _e45 = textureSampleGrad(tex2D, samp, _e40, vec2(4f), vec2(4f)); - c_2 = _e45; - let _e53 = coord_5; - let _e60 = textureSampleGrad(tex2D, samp, _e53, vec2(4f), vec2(4f), vec2(5i)); - c_2 = _e60; - let _e63 = coord_5; - let _e65 = textureSampleLevel(tex2D, samp, _e63, 3f); - c_2 = _e65; - let _e70 = coord_5; - let _e74 = textureSampleLevel(tex2D, samp, _e70, 3f, vec2(5i)); - c_2 = _e74; - let _e78 = coord_5; - let _e81 = textureSample(tex2D, samp, _e78, vec2(5i)); - c_2 = _e81; - let _e86 = coord_5; - let _e90 = textureSampleBias(tex2D, samp, _e86, 2f, vec2(5i)); - c_2 = _e90; - let _e91 = coord_5; - let _e96 = coord_5; - let _e100 = vec3(_e96.x, _e96.y, 6f); - let _e105 = textureSample(tex2D, samp, (_e100.xy / vec2(_e100.z))); - c_2 = _e105; - let _e106 = coord_5; - let _e112 = coord_5; - let _e117 = vec4(_e112.x, _e112.y, 0f, 6f); - let _e123 = textureSample(tex2D, samp, (_e117.xyz / vec3(_e117.w)).xy); - c_2 = _e123; - let _e124 = coord_5; - let _e130 = coord_5; - let _e134 = vec3(_e130.x, _e130.y, 6f); - let _e140 = textureSampleBias(tex2D, samp, (_e134.xy / vec2(_e134.z)), 2f); - c_2 = _e140; - let _e141 = coord_5; - let _e148 = coord_5; - let _e153 = vec4(_e148.x, _e148.y, 0f, 6f); - let _e160 = textureSampleBias(tex2D, samp, (_e153.xyz / vec3(_e153.w)).xy, 2f); - c_2 = _e160; - let _e161 = coord_5; - let _e170 = coord_5; - let _e174 = vec3(_e170.x, _e170.y, 6f); - let _e183 = textureSampleGrad(tex2D, samp, (_e174.xy / vec2(_e174.z)), vec2(4f), vec2(4f)); - c_2 = _e183; - let _e184 = coord_5; - let _e194 = coord_5; - let _e199 = vec4(_e194.x, _e194.y, 0f, 6f); - let _e209 = textureSampleGrad(tex2D, samp, (_e199.xyz / vec3(_e199.w)).xy, vec2(4f), vec2(4f)); - c_2 = _e209; - let _e210 = coord_5; - let _e221 = coord_5; - let _e225 = vec3(_e221.x, _e221.y, 6f); - let _e236 = textureSampleGrad(tex2D, samp, (_e225.xy / vec2(_e225.z)), vec2(4f), vec2(4f), vec2(5i)); - c_2 = _e236; - let _e237 = coord_5; - let _e249 = coord_5; - let _e254 = vec4(_e249.x, _e249.y, 0f, 6f); - let _e266 = textureSampleGrad(tex2D, samp, (_e254.xyz / vec3(_e254.w)).xy, vec2(4f), vec2(4f), vec2(5i)); - c_2 = _e266; - let _e267 = coord_5; - let _e273 = coord_5; - let _e277 = vec3(_e273.x, _e273.y, 6f); - let _e283 = textureSampleLevel(tex2D, samp, (_e277.xy / vec2(_e277.z)), 3f); - c_2 = _e283; - let _e284 = coord_5; - let _e291 = coord_5; - let _e296 = vec4(_e291.x, _e291.y, 0f, 6f); - let _e303 = textureSampleLevel(tex2D, samp, (_e296.xyz / vec3(_e296.w)).xy, 3f); - c_2 = _e303; - let _e304 = coord_5; - let _e312 = coord_5; - let _e316 = vec3(_e312.x, _e312.y, 6f); - let _e324 = textureSampleLevel(tex2D, samp, (_e316.xy / vec2(_e316.z)), 3f, vec2(5i)); - c_2 = _e324; - let _e325 = coord_5; - let _e334 = coord_5; - let _e339 = vec4(_e334.x, _e334.y, 0f, 6f); - let _e348 = textureSampleLevel(tex2D, samp, (_e339.xyz / vec3(_e339.w)).xy, 3f, vec2(5i)); - c_2 = _e348; - let _e349 = coord_5; - let _e356 = coord_5; - let _e360 = vec3(_e356.x, _e356.y, 6f); - let _e367 = textureSample(tex2D, samp, (_e360.xy / vec2(_e360.z)), vec2(5i)); - c_2 = _e367; - let _e368 = coord_5; - let _e376 = coord_5; - let _e381 = vec4(_e376.x, _e376.y, 0f, 6f); - let _e389 = textureSample(tex2D, samp, (_e381.xyz / vec3(_e381.w)).xy, vec2(5i)); - c_2 = _e389; - let _e390 = coord_5; - let _e398 = coord_5; - let _e402 = vec3(_e398.x, _e398.y, 6f); - let _e410 = textureSampleBias(tex2D, samp, (_e402.xy / vec2(_e402.z)), 2f, vec2(5i)); - c_2 = _e410; - let _e411 = coord_5; - let _e420 = coord_5; - let _e425 = vec4(_e420.x, _e420.y, 0f, 6f); - let _e434 = textureSampleBias(tex2D, samp, (_e425.xyz / vec3(_e425.w)).xy, 2f, vec2(5i)); - c_2 = _e434; - let _e435 = coord_5; - let _e438 = coord_5; - let _e441 = textureLoad(tex2D, vec2(_e438), 3i); - c_2 = _e441; - let _e442 = coord_5; + let _e22 = textureDimensions(tex2D, 0i); + size2D = vec2(_e22); + let _e25 = textureNumLevels(tex2D); + levels_2 = i32(_e25); + 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 _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 _e452 = textureLoad(tex2D, vec2(_e447), 3i); - c_2 = _e452; + 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); return; } @@ -339,76 +359,76 @@ fn testTex2DShadow(coord_6: vec2) { var d: f32; coord_7 = coord_6; - let _e20 = textureDimensions(tex2DShadow, 0i); - size2DShadow = vec2(_e20); - let _e23 = textureNumLevels(tex2DShadow); - levels_3 = i32(_e23); - let _e27 = coord_7; - let _e32 = coord_7; - let _e36 = vec3(_e32.x, _e32.y, 1f); - let _e39 = textureSampleCompare(tex2DShadow, sampShadow, _e36.xy, _e36.z); - d = _e39; - let _e40 = coord_7; - let _e49 = coord_7; - let _e53 = vec3(_e49.x, _e49.y, 1f); - let _e60 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e53.xy, _e53.z); - d = _e60; - let _e61 = coord_7; - let _e72 = coord_7; - let _e76 = vec3(_e72.x, _e72.y, 1f); - let _e85 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e76.xy, _e76.z, vec2(5i)); - d = _e85; - let _e86 = coord_7; - let _e92 = coord_7; - let _e96 = vec3(_e92.x, _e92.y, 1f); - let _e100 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e96.xy, _e96.z); - d = _e100; - let _e101 = coord_7; - let _e109 = coord_7; - let _e113 = vec3(_e109.x, _e109.y, 1f); - let _e119 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e113.xy, _e113.z, vec2(5i)); - d = _e119; - let _e120 = coord_7; - let _e127 = coord_7; - let _e131 = vec3(_e127.x, _e127.y, 1f); - let _e136 = textureSampleCompare(tex2DShadow, sampShadow, _e131.xy, _e131.z, vec2(5i)); - d = _e136; - let _e137 = coord_7; - let _e143 = coord_7; - let _e148 = vec4(_e143.x, _e143.y, 1f, 6f); - let _e152 = (_e148.xyz / vec3(_e148.w)); - let _e155 = textureSampleCompare(tex2DShadow, sampShadow, _e152.xy, _e152.z); - d = _e155; - let _e156 = coord_7; - let _e166 = coord_7; - let _e171 = vec4(_e166.x, _e166.y, 1f, 6f); - let _e179 = (_e171.xyz / vec3(_e171.w)); - let _e182 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e179.xy, _e179.z); - d = _e182; - let _e183 = coord_7; - let _e195 = coord_7; - let _e200 = vec4(_e195.x, _e195.y, 1f, 6f); - let _e210 = (_e200.xyz / vec3(_e200.w)); - let _e213 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e210.xy, _e210.z, vec2(5i)); - d = _e213; - let _e214 = coord_7; - let _e221 = coord_7; - let _e226 = vec4(_e221.x, _e221.y, 1f, 6f); - let _e231 = (_e226.xyz / vec3(_e226.w)); - let _e234 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e231.xy, _e231.z); - d = _e234; - let _e235 = coord_7; - let _e244 = coord_7; - let _e249 = vec4(_e244.x, _e244.y, 1f, 6f); - let _e256 = (_e249.xyz / vec3(_e249.w)); - let _e259 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e256.xy, _e256.z, vec2(5i)); - d = _e259; - let _e260 = coord_7; - let _e268 = coord_7; - let _e273 = vec4(_e268.x, _e268.y, 1f, 6f); - let _e279 = (_e273.xyz / vec3(_e273.w)); - let _e282 = textureSampleCompare(tex2DShadow, sampShadow, _e279.xy, _e279.z, vec2(5i)); - d = _e282; + 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)); + 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; return; } @@ -419,45 +439,45 @@ fn testTex2DArray(coord_8: vec3) { var c_3: vec4; coord_9 = coord_8; - let _e20 = textureDimensions(tex2DArray, 0i); - let _e23 = textureNumLayers(tex2DArray); - size2DArray = vec3(vec3(_e20.x, _e20.y, _e23)); - let _e27 = textureNumLevels(tex2DArray); - levels_4 = i32(_e27); - let _e32 = coord_9; - let _e36 = textureSample(tex2DArray, samp, _e32.xy, i32(_e32.z)); - c_3 = _e36; - let _e39 = coord_9; - let _e44 = textureSampleBias(tex2DArray, samp, _e39.xy, i32(_e39.z), 2f); - c_3 = _e44; - let _e50 = coord_9; - let _e58 = textureSampleGrad(tex2DArray, samp, _e50.xy, i32(_e50.z), vec2(4f), vec2(4f)); - c_3 = _e58; - let _e66 = coord_9; - let _e76 = textureSampleGrad(tex2DArray, samp, _e66.xy, i32(_e66.z), vec2(4f), vec2(4f), vec2(5i)); - c_3 = _e76; - let _e79 = coord_9; - let _e84 = textureSampleLevel(tex2DArray, samp, _e79.xy, i32(_e79.z), 3f); - c_3 = _e84; - let _e89 = coord_9; - let _e96 = textureSampleLevel(tex2DArray, samp, _e89.xy, i32(_e89.z), 3f, vec2(5i)); - c_3 = _e96; - let _e100 = coord_9; - let _e106 = textureSample(tex2DArray, samp, _e100.xy, i32(_e100.z), vec2(5i)); - c_3 = _e106; - let _e111 = coord_9; - let _e118 = textureSampleBias(tex2DArray, samp, _e111.xy, i32(_e111.z), 2f, vec2(5i)); - c_3 = _e118; - let _e119 = coord_9; - let _e122 = coord_9; - let _e123 = vec3(_e122); - let _e127 = textureLoad(tex2DArray, _e123.xy, _e123.z, 3i); - c_3 = _e127; - let _e128 = coord_9; - let _e133 = coord_9; - let _e134 = vec3(_e133); - let _e140 = textureLoad(tex2DArray, _e134.xy, _e134.z, 3i); - c_3 = _e140; + 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 _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; return; } @@ -468,31 +488,31 @@ fn testTex2DArrayShadow(coord_10: vec3) { var d_1: f32; coord_11 = coord_10; - let _e20 = textureDimensions(tex2DArrayShadow, 0i); - let _e23 = textureNumLayers(tex2DArrayShadow); - size2DArrayShadow = vec3(vec3(_e20.x, _e20.y, _e23)); - let _e27 = textureNumLevels(tex2DArrayShadow); - levels_5 = i32(_e27); - let _e31 = coord_11; - let _e37 = coord_11; - let _e42 = vec4(_e37.x, _e37.y, _e37.z, 1f); - let _e47 = textureSampleCompare(tex2DArrayShadow, sampShadow, _e42.xy, i32(_e42.z), _e42.w); - d_1 = _e47; - let _e48 = coord_11; - let _e58 = coord_11; - let _e63 = vec4(_e58.x, _e58.y, _e58.z, 1f); - let _e72 = textureSampleCompareLevel(tex2DArrayShadow, sampShadow, _e63.xy, i32(_e63.z), _e63.w); - d_1 = _e72; - let _e73 = coord_11; - let _e85 = coord_11; - let _e90 = vec4(_e85.x, _e85.y, _e85.z, 1f); - let _e101 = textureSampleCompareLevel(tex2DArrayShadow, sampShadow, _e90.xy, i32(_e90.z), _e90.w, vec2(5i)); - d_1 = _e101; - let _e102 = coord_11; - let _e110 = coord_11; - let _e115 = vec4(_e110.x, _e110.y, _e110.z, 1f); - let _e122 = textureSampleCompare(tex2DArrayShadow, sampShadow, _e115.xy, i32(_e115.z), _e115.w, vec2(5i)); - d_1 = _e122; + 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); + 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; return; } @@ -503,22 +523,22 @@ fn testTexCube(coord_12: vec3) { var c_4: vec4; coord_13 = coord_12; - let _e20 = textureDimensions(texCube, 0i); - sizeCube = vec2(_e20); - let _e23 = textureNumLevels(texCube); - levels_6 = i32(_e23); - let _e28 = coord_13; - let _e29 = textureSample(texCube, samp, _e28); - c_4 = _e29; - let _e32 = coord_13; - let _e34 = textureSampleBias(texCube, samp, _e32, 2f); - c_4 = _e34; - let _e40 = coord_13; - let _e45 = textureSampleGrad(texCube, samp, _e40, vec3(4f), vec3(4f)); - c_4 = _e45; - let _e48 = coord_13; - let _e50 = textureSampleLevel(texCube, samp, _e48, 3f); - c_4 = _e50; + let _e22 = textureDimensions(texCube, 0i); + sizeCube = vec2(_e22); + let _e25 = textureNumLevels(texCube); + levels_6 = i32(_e25); + 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; return; } @@ -529,20 +549,20 @@ fn testTexCubeShadow(coord_14: vec3) { var d_2: f32; coord_15 = coord_14; - let _e20 = textureDimensions(texCubeShadow, 0i); - sizeCubeShadow = vec2(_e20); - let _e23 = textureNumLevels(texCubeShadow); - levels_7 = i32(_e23); - let _e27 = coord_15; - let _e33 = coord_15; - let _e38 = vec4(_e33.x, _e33.y, _e33.z, 1f); - let _e41 = textureSampleCompare(texCubeShadow, sampShadow, _e38.xyz, _e38.w); - d_2 = _e41; - let _e42 = coord_15; - let _e52 = coord_15; - let _e57 = vec4(_e52.x, _e52.y, _e52.z, 1f); - let _e64 = textureSampleCompareLevel(texCubeShadow, sampShadow, _e57.xyz, _e57.w); - d_2 = _e64; + 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; return; } @@ -553,23 +573,23 @@ fn testTexCubeArray(coord_16: vec4) { var c_5: vec4; coord_17 = coord_16; - let _e20 = textureDimensions(texCubeArray, 0i); - let _e23 = textureNumLayers(texCubeArray); - sizeCubeArray = vec3(vec3(_e20.x, _e20.y, _e23)); - let _e27 = textureNumLevels(texCubeArray); - levels_8 = i32(_e27); - let _e32 = coord_17; - let _e36 = textureSample(texCubeArray, samp, _e32.xyz, i32(_e32.w)); - c_5 = _e36; - let _e39 = coord_17; - let _e44 = textureSampleBias(texCubeArray, samp, _e39.xyz, i32(_e39.w), 2f); - c_5 = _e44; - let _e50 = coord_17; - let _e58 = textureSampleGrad(texCubeArray, samp, _e50.xyz, i32(_e50.w), vec3(4f), vec3(4f)); - c_5 = _e58; - let _e61 = coord_17; - let _e66 = textureSampleLevel(texCubeArray, samp, _e61.xyz, i32(_e61.w), 3f); - c_5 = _e66; + 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 _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; return; } @@ -580,14 +600,14 @@ fn testTexCubeArrayShadow(coord_18: vec4) { var d_3: f32; coord_19 = coord_18; - let _e20 = textureDimensions(texCubeArrayShadow, 0i); - let _e23 = textureNumLayers(texCubeArrayShadow); - sizeCubeArrayShadow = vec3(vec3(_e20.x, _e20.y, _e23)); - let _e27 = textureNumLevels(texCubeArrayShadow); - levels_9 = i32(_e27); - let _e33 = coord_19; - let _e38 = textureSampleCompare(texCubeArrayShadow, sampShadow, _e33.xyz, i32(_e33.w), 1f); - d_3 = _e38; + 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; return; } @@ -598,82 +618,82 @@ fn testTex3D(coord_20: vec3) { var c_6: vec4; coord_21 = coord_20; - let _e20 = textureDimensions(tex3D, 0i); - size3D = vec3(_e20); - let _e23 = textureNumLevels(tex3D); - levels_10 = i32(_e23); - let _e28 = coord_21; - let _e29 = textureSample(tex3D, samp, _e28); - c_6 = _e29; - let _e32 = coord_21; - let _e34 = textureSampleBias(tex3D, samp, _e32, 2f); - c_6 = _e34; - let _e35 = coord_21; - let _e41 = coord_21; - let _e46 = vec4(_e41.x, _e41.y, _e41.z, 6f); - let _e51 = textureSample(tex3D, samp, (_e46.xyz / vec3(_e46.w))); - c_6 = _e51; - let _e52 = coord_21; - let _e59 = coord_21; - let _e64 = vec4(_e59.x, _e59.y, _e59.z, 6f); - let _e70 = textureSampleBias(tex3D, samp, (_e64.xyz / vec3(_e64.w)), 2f); - c_6 = _e70; - let _e71 = coord_21; - let _e79 = coord_21; - let _e84 = vec4(_e79.x, _e79.y, _e79.z, 6f); - let _e91 = textureSample(tex3D, samp, (_e84.xyz / vec3(_e84.w)), vec3(5i)); - c_6 = _e91; - let _e92 = coord_21; - let _e101 = coord_21; - let _e106 = vec4(_e101.x, _e101.y, _e101.z, 6f); - let _e114 = textureSampleBias(tex3D, samp, (_e106.xyz / vec3(_e106.w)), 2f, vec3(5i)); - c_6 = _e114; - let _e115 = coord_21; - let _e122 = coord_21; - let _e127 = vec4(_e122.x, _e122.y, _e122.z, 6f); - let _e133 = textureSampleLevel(tex3D, samp, (_e127.xyz / vec3(_e127.w)), 3f); - c_6 = _e133; - let _e134 = coord_21; - let _e143 = coord_21; - let _e148 = vec4(_e143.x, _e143.y, _e143.z, 6f); - let _e156 = textureSampleLevel(tex3D, samp, (_e148.xyz / vec3(_e148.w)), 3f, vec3(5i)); - c_6 = _e156; - let _e157 = coord_21; - let _e167 = coord_21; - let _e172 = vec4(_e167.x, _e167.y, _e167.z, 6f); - let _e181 = textureSampleGrad(tex3D, samp, (_e172.xyz / vec3(_e172.w)), vec3(4f), vec3(4f)); - c_6 = _e181; - let _e182 = coord_21; - let _e194 = coord_21; - let _e199 = vec4(_e194.x, _e194.y, _e194.z, 6f); - let _e210 = textureSampleGrad(tex3D, samp, (_e199.xyz / vec3(_e199.w)), vec3(4f), vec3(4f), vec3(5i)); - c_6 = _e210; - let _e216 = coord_21; - let _e221 = textureSampleGrad(tex3D, samp, _e216, vec3(4f), vec3(4f)); - c_6 = _e221; - let _e229 = coord_21; - let _e236 = textureSampleGrad(tex3D, samp, _e229, vec3(4f), vec3(4f), vec3(5i)); - c_6 = _e236; - let _e239 = coord_21; - let _e241 = textureSampleLevel(tex3D, samp, _e239, 3f); - c_6 = _e241; - let _e246 = coord_21; - let _e250 = textureSampleLevel(tex3D, samp, _e246, 3f, vec3(5i)); - c_6 = _e250; - let _e254 = coord_21; - let _e257 = textureSample(tex3D, samp, _e254, vec3(5i)); - c_6 = _e257; - let _e262 = coord_21; - let _e266 = textureSampleBias(tex3D, samp, _e262, 2f, vec3(5i)); - c_6 = _e266; - let _e267 = coord_21; - let _e270 = coord_21; - let _e273 = textureLoad(tex3D, vec3(_e270), 3i); - c_6 = _e273; - let _e274 = coord_21; - let _e279 = coord_21; - let _e284 = textureLoad(tex3D, vec3(_e279), 3i); - c_6 = _e284; + let _e22 = textureDimensions(tex3D, 0i); + size3D = vec3(_e22); + let _e25 = textureNumLevels(tex3D); + levels_10 = i32(_e25); + 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 _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; return; } @@ -683,12 +703,12 @@ fn testTex2DMS(coord_22: vec2) { var c_7: vec4; coord_23 = coord_22; - let _e18 = textureDimensions(tex2DMS); - size2DMS = vec2(_e18); - let _e22 = coord_23; - let _e25 = coord_23; - let _e28 = textureLoad(tex2DMS, vec2(_e25), 3i); - c_7 = _e28; + 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; return; } @@ -698,14 +718,14 @@ fn testTex2DMSArray(coord_24: vec3) { var c_8: vec4; coord_25 = coord_24; - let _e18 = textureDimensions(tex2DMSArray); - let _e21 = textureNumLayers(tex2DMSArray); - size2DMSArray = vec3(vec3(_e18.x, _e18.y, _e21)); - let _e26 = coord_25; - let _e29 = coord_25; - let _e30 = vec3(_e29); - let _e34 = textureLoad(tex2DMSArray, _e30.xy, _e30.z, 3i); - c_8 = _e34; + let _e20 = textureDimensions(tex2DMSArray); + 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; return; }