diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e72f1c986..894c38085e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -116,6 +116,7 @@ By @bradwerth [#6216](https://github.com/gfx-rs/wgpu/pull/6216). - Fix handling of phony statements, so they are actually emitted. By @sagudev in [#6328](https://github.com/gfx-rs/wgpu/pull/6328). - Added `gl_DrawID` to glsl and `DrawIndex` to spv. By @ChosenName in [#6325](https://github.com/gfx-rs/wgpu/pull/6325). - Matrices can now be indexed by value (#4337), and indexing arrays by value no longer causes excessive spilling (#6358). By @jimblandy in [#6390](https://github.com/gfx-rs/wgpu/pull/6390). +- Add support for `textureQueryLevels` to the GLSL parser. By @magcius in [#6325](https://github.com/gfx-rs/wgpu/pull/6415). #### General diff --git a/naga/src/front/glsl/builtins.rs b/naga/src/front/glsl/builtins.rs index f76ce7754a..2c11b9d621 100644 --- a/naga/src/front/glsl/builtins.rs +++ b/naga/src/front/glsl/builtins.rs @@ -292,6 +292,26 @@ pub fn inject_builtin( f, ) } + "textureQueryLevels" => { + let f = |kind, dim, arrayed, multi, shadow| { + let class = match shadow { + true => ImageClass::Depth { multi }, + false => ImageClass::Sampled { kind, multi }, + }; + + let image = TypeInner::Image { + dim, + arrayed, + class, + }; + + declaration + .overloads + .push(module.add_builtin(vec![image], MacroCall::TextureQueryLevels)) + }; + + texture_args_generator(TextureArgsOptions::SHADOW | variations.into(), f) + } "texelFetch" | "texelFetchOffset" => { let offset = "texelFetchOffset" == name; let f = |kind, dim, arrayed, multi, _shadow| { @@ -1515,6 +1535,7 @@ pub enum MacroCall { TextureSize { arrayed: bool, }, + TextureQueryLevels, ImageLoad { multi: bool, }, @@ -1747,6 +1768,24 @@ impl MacroCall { Span::default(), )? } + MacroCall::TextureQueryLevels => { + let expr = ctx.add_expression( + Expression::ImageQuery { + image: args[0], + query: ImageQuery::NumLevels, + }, + Span::default(), + )?; + + ctx.add_expression( + Expression::As { + expr, + kind: Sk::Sint, + convert: Some(4), + }, + Span::default(), + )? + } MacroCall::ImageLoad { multi } => { let comps = frontend.coordinate_components(ctx, args[0], args[1], None, meta)?; let (sample, level) = match (multi, args.get(2)) { diff --git a/naga/tests/in/glsl/samplers.frag b/naga/tests/in/glsl/samplers.frag index a1a438db9a..25a4387fe9 100644 --- a/naga/tests/in/glsl/samplers.frag +++ b/naga/tests/in/glsl/samplers.frag @@ -38,6 +38,7 @@ layout(binding = 19) uniform texture2DMSArray tex2DMSArray; void testTex1D(in float coord) { int size1D = textureSize(sampler1D(tex1D, samp), 0); + int levels = textureQueryLevels(sampler1D(tex1D, samp)); vec4 c; c = texture(sampler1D(tex1D, samp), coord); c = texture(sampler1D(tex1D, samp), coord, 2.0); @@ -70,6 +71,7 @@ void testTex1D(in float coord) { #if HAS_1D_DEPTH_TEXTURES void testTex1DShadow(float coord) { int size1DShadow = textureSize(sampler1DShadow(tex1DShadow, sampShadow), 0); + int levels = textureQueryLevels(sampler1DShadow(tex1DShadow, sampShadow)); float d; d = texture(sampler1DShadow(tex1DShadow, sampShadow), vec3(coord, 1.0, 1.0)); // d = texture(sampler1DShadow(tex1DShadow, sampShadow), vec3(coord, 1.0, 1.0), 2.0); @@ -92,6 +94,7 @@ void testTex1DShadow(float coord) { void testTex1DArray(in vec2 coord) { ivec2 size1DArray = textureSize(sampler1DArray(tex1DArray, samp), 0); + int levels = textureQueryLevels(sampler1DArray(tex1DArray, samp)); vec4 c; c = texture(sampler1DArray(tex1DArray, samp), coord); c = texture(sampler1DArray(tex1DArray, samp), coord, 2.0); @@ -108,6 +111,7 @@ void testTex1DArray(in vec2 coord) { #if HAS_1D_DEPTH_TEXTURES void testTex1DArrayShadow(in vec2 coord) { ivec2 size1DArrayShadow = textureSize(sampler1DArrayShadow(tex1DArrayShadow, sampShadow), 0); + int levels = textureQueryLevels(sampler1DArrayShadow(tex1DArrayShadow, sampShadow)); float d; d = texture(sampler1DArrayShadow(tex1DArrayShadow, sampShadow), vec3(coord, 1.0)); d = textureGrad(sampler1DArrayShadow(tex1DArrayShadow, sampShadow), vec3(coord, 1.0), 4.0, 4.0); @@ -121,6 +125,7 @@ void testTex1DArrayShadow(in vec2 coord) { void testTex2D(in vec2 coord) { ivec2 size2D = textureSize(sampler2D(tex2D, samp), 0); + int levels = textureQueryLevels(sampler2D(tex2D, samp)); vec4 c; c = texture(sampler2D(tex2D, samp), coord); c = texture(sampler2D(tex2D, samp), coord, 2.0); @@ -152,6 +157,7 @@ void testTex2D(in vec2 coord) { void testTex2DShadow(vec2 coord) { ivec2 size2DShadow = textureSize(sampler2DShadow(tex2DShadow, sampShadow), 0); + int levels = textureQueryLevels(sampler2DShadow(tex2DShadow, sampShadow)); float d; d = texture(sampler2DShadow(tex2DShadow, sampShadow), vec3(coord, 1.0)); // d = texture(sampler2DShadow(tex2DShadow, sampShadow), vec3(coord, 1.0), 2.0); @@ -173,6 +179,7 @@ void testTex2DShadow(vec2 coord) { void testTex2DArray(in vec3 coord) { ivec3 size2DArray = textureSize(sampler2DArray(tex2DArray, samp), 0); + int levels = textureQueryLevels(sampler2DArray(tex2DArray, samp)); vec4 c; c = texture(sampler2DArray(tex2DArray, samp), coord); c = texture(sampler2DArray(tex2DArray, samp), coord, 2.0); @@ -188,6 +195,7 @@ void testTex2DArray(in vec3 coord) { void testTex2DArrayShadow(in vec3 coord) { ivec3 size2DArrayShadow = textureSize(sampler2DArrayShadow(tex2DArrayShadow, sampShadow), 0); + int levels = textureQueryLevels(sampler2DArrayShadow(tex2DArrayShadow, sampShadow)); float d; d = texture(sampler2DArrayShadow(tex2DArrayShadow, sampShadow), vec4(coord, 1.0)); d = textureGrad(sampler2DArrayShadow(tex2DArrayShadow, sampShadow), vec4(coord, 1.0), vec2(4.0), vec2(4.0)); @@ -197,6 +205,7 @@ void testTex2DArrayShadow(in vec3 coord) { void testTexCube(in vec3 coord) { ivec2 sizeCube = textureSize(samplerCube(texCube, samp), 0); + int levels = textureQueryLevels(samplerCube(texCube, samp)); vec4 c; c = texture(samplerCube(texCube, samp), coord); c = texture(samplerCube(texCube, samp), coord, 2.0); @@ -206,6 +215,7 @@ void testTexCube(in vec3 coord) { void testTexCubeShadow(in vec3 coord) { ivec2 sizeCubeShadow = textureSize(samplerCubeShadow(texCubeShadow, sampShadow), 0); + int levels = textureQueryLevels(samplerCubeShadow(texCubeShadow, sampShadow)); float d; d = texture(samplerCubeShadow(texCubeShadow, sampShadow), vec4(coord, 1.0)); d = textureGrad(samplerCubeShadow(texCubeShadow, sampShadow), vec4(coord, 1.0), vec3(4.0), vec3(4.0)); @@ -213,6 +223,7 @@ void testTexCubeShadow(in vec3 coord) { void testTexCubeArray(in vec4 coord) { ivec3 sizeCubeArray = textureSize(samplerCubeArray(texCubeArray, samp), 0); + int levels = textureQueryLevels(samplerCubeArray(texCubeArray, samp)); vec4 c; c = texture(samplerCubeArray(texCubeArray, samp), coord); c = texture(samplerCubeArray(texCubeArray, samp), coord, 2.0); @@ -222,6 +233,7 @@ void testTexCubeArray(in vec4 coord) { void testTexCubeArrayShadow(in vec4 coord) { ivec3 sizeCubeArrayShadow = textureSize(samplerCubeArrayShadow(texCubeArrayShadow, sampShadow), 0); + int levels = textureQueryLevels(samplerCubeArrayShadow(texCubeArrayShadow, sampShadow)); float d; d = texture(samplerCubeArrayShadow(texCubeArrayShadow, sampShadow), coord, 1.0); // The rest of the variants aren't defined by GLSL. @@ -229,6 +241,7 @@ void testTexCubeArrayShadow(in vec4 coord) { void testTex3D(in vec3 coord) { ivec3 size3D = textureSize(sampler3D(tex3D, samp), 0); + int levels = textureQueryLevels(sampler3D(tex3D, samp)); vec4 c; c = texture(sampler3D(tex3D, samp), coord); c = texture(sampler3D(tex3D, samp), coord, 2.0); diff --git a/naga/tests/out/wgsl/samplers.frag.wgsl b/naga/tests/out/wgsl/samplers.frag.wgsl index 4306e6683f..387ef43bd0 100644 --- a/naga/tests/out/wgsl/samplers.frag.wgsl +++ b/naga/tests/out/wgsl/samplers.frag.wgsl @@ -34,613 +34,646 @@ var tex2DMSArray: texture_multisampled_2d_array; fn testTex1D(coord: f32) { var coord_1: f32; var size1D: i32; + var levels: i32; var c: vec4; coord_1 = coord; let _e20 = textureDimensions(tex1D, 0i); size1D = i32(_e20); - let _e25 = coord_1; - let _e26 = textureSample(tex1D, samp, _e25); - c = _e26; - let _e29 = coord_1; - let _e31 = textureSampleBias(tex1D, samp, _e29, 2f); - c = _e31; - let _e35 = coord_1; - let _e38 = textureSampleGrad(tex1D, samp, _e35, 4f, 4f); - 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 _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 _e68 = coord_1; - let _e71 = textureSampleBias(tex1D, samp, _e68, 2f, 5i); - c = _e71; - let _e72 = coord_1; + 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 _e77 = vec2(_e75, 6f); - let _e81 = textureSample(tex1D, samp, (_e77.x / _e77.y)); - c = _e81; - let _e82 = coord_1; - let _e87 = coord_1; - let _e91 = vec4(_e87, 0f, 0f, 6f); - let _e97 = textureSample(tex1D, samp, (_e91.xyz / vec3(_e91.w)).x); - c = _e97; - let _e98 = coord_1; - let _e102 = coord_1; - let _e104 = vec2(_e102, 6f); - let _e109 = textureSampleBias(tex1D, samp, (_e104.x / _e104.y), 2f); - c = _e109; - let _e110 = coord_1; - let _e116 = coord_1; - let _e120 = vec4(_e116, 0f, 0f, 6f); - let _e127 = textureSampleBias(tex1D, samp, (_e120.xyz / vec3(_e120.w)).x, 2f); - c = _e127; - let _e128 = coord_1; - let _e133 = coord_1; - let _e135 = vec2(_e133, 6f); - let _e141 = textureSampleGrad(tex1D, samp, (_e135.x / _e135.y), 4f, 4f); - c = _e141; - let _e142 = coord_1; - let _e149 = coord_1; - let _e153 = vec4(_e149, 0f, 0f, 6f); - let _e161 = textureSampleGrad(tex1D, samp, (_e153.xyz / vec3(_e153.w)).x, 4f, 4f); - c = _e161; - let _e162 = coord_1; - let _e168 = coord_1; - let _e170 = vec2(_e168, 6f); - let _e177 = textureSampleGrad(tex1D, samp, (_e170.x / _e170.y), 4f, 4f, 5i); - c = _e177; - let _e178 = coord_1; - let _e186 = coord_1; - let _e190 = vec4(_e186, 0f, 0f, 6f); - let _e199 = textureSampleGrad(tex1D, samp, (_e190.xyz / vec3(_e190.w)).x, 4f, 4f, 5i); - c = _e199; - let _e200 = coord_1; - let _e204 = coord_1; - let _e206 = vec2(_e204, 6f); - let _e211 = textureSampleLevel(tex1D, samp, (_e206.x / _e206.y), 3f); - c = _e211; - let _e212 = coord_1; - let _e218 = coord_1; - let _e222 = vec4(_e218, 0f, 0f, 6f); - let _e229 = textureSampleLevel(tex1D, samp, (_e222.xyz / vec3(_e222.w)).x, 3f); - c = _e229; - let _e230 = coord_1; - let _e235 = coord_1; - let _e237 = vec2(_e235, 6f); - let _e243 = textureSampleLevel(tex1D, samp, (_e237.x / _e237.y), 3f, 5i); - c = _e243; - let _e244 = coord_1; - let _e251 = coord_1; - let _e255 = vec4(_e251, 0f, 0f, 6f); - let _e263 = textureSampleLevel(tex1D, samp, (_e255.xyz / vec3(_e255.w)).x, 3f, 5i); - c = _e263; - let _e264 = coord_1; - let _e268 = coord_1; - let _e270 = vec2(_e268, 6f); - let _e275 = textureSample(tex1D, samp, (_e270.x / _e270.y), 5i); - c = _e275; - let _e276 = coord_1; - let _e282 = coord_1; - let _e286 = vec4(_e282, 0f, 0f, 6f); - let _e293 = textureSample(tex1D, samp, (_e286.xyz / vec3(_e286.w)).x, 5i); - c = _e293; - let _e294 = coord_1; - let _e299 = coord_1; - let _e301 = vec2(_e299, 6f); - let _e307 = textureSampleBias(tex1D, samp, (_e301.x / _e301.y), 2f, 5i); - c = _e307; - let _e308 = coord_1; - let _e315 = coord_1; - let _e319 = vec4(_e315, 0f, 0f, 6f); - let _e327 = textureSampleBias(tex1D, samp, (_e319.xyz / vec3(_e319.w)).x, 2f, 5i); - c = _e327; - let _e328 = 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 = textureLoad(tex1D, i32(_e331), 3i); - c = _e334; - let _e335 = coord_1; - let _e339 = coord_1; - let _e343 = textureLoad(tex1D, i32(_e339), 3i); - c = _e343; + 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; return; } fn testTex1DArray(coord_2: vec2) { var coord_3: vec2; var size1DArray: vec2; + var levels_1: i32; var c_1: vec4; coord_3 = coord_2; let _e20 = textureDimensions(tex1DArray, 0i); let _e21 = textureNumLayers(tex1DArray); size1DArray = vec2(vec2(_e20, _e21)); - let _e27 = coord_3; - let _e31 = textureSample(tex1DArray, samp, _e27.x, i32(_e27.y)); - c_1 = _e31; - let _e34 = coord_3; - let _e39 = textureSampleBias(tex1DArray, samp, _e34.x, i32(_e34.y), 2f); - c_1 = _e39; - let _e43 = coord_3; - let _e49 = textureSampleGrad(tex1DArray, samp, _e43.x, i32(_e43.y), 4f, 4f); - c_1 = _e49; - let _e54 = coord_3; - let _e61 = textureSampleGrad(tex1DArray, samp, _e54.x, i32(_e54.y), 4f, 4f, 5i); - c_1 = _e61; - let _e64 = coord_3; - let _e69 = textureSampleLevel(tex1DArray, samp, _e64.x, i32(_e64.y), 3f); - c_1 = _e69; - let _e73 = coord_3; - let _e79 = textureSampleLevel(tex1DArray, samp, _e73.x, i32(_e73.y), 3f, 5i); - c_1 = _e79; - let _e82 = coord_3; - let _e87 = textureSample(tex1DArray, samp, _e82.x, i32(_e82.y), 5i); - c_1 = _e87; - let _e91 = coord_3; - let _e97 = textureSampleBias(tex1DArray, samp, _e91.x, i32(_e91.y), 2f, 5i); - c_1 = _e97; - let _e98 = coord_3; + 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 _e102 = vec2(_e101); - let _e106 = textureLoad(tex1DArray, _e102.x, _e102.y, 3i); - c_1 = _e106; - let _e107 = coord_3; - let _e111 = coord_3; - let _e112 = vec2(_e111); - let _e117 = textureLoad(tex1DArray, _e112.x, _e112.y, 3i); - c_1 = _e117; + 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; return; } fn testTex2D(coord_4: vec2) { var coord_5: vec2; var size2D: vec2; + var levels_2: i32; var c_2: vec4; coord_5 = coord_4; let _e20 = textureDimensions(tex2D, 0i); size2D = vec2(_e20); - let _e25 = coord_5; - let _e26 = textureSample(tex2D, samp, _e25); - c_2 = _e26; - let _e29 = coord_5; - let _e31 = textureSampleBias(tex2D, samp, _e29, 2f); - c_2 = _e31; - let _e37 = coord_5; - let _e42 = textureSampleGrad(tex2D, samp, _e37, vec2(4f), vec2(4f)); - c_2 = _e42; - let _e50 = coord_5; - let _e57 = textureSampleGrad(tex2D, samp, _e50, vec2(4f), vec2(4f), vec2(5i)); - c_2 = _e57; - let _e60 = coord_5; - let _e62 = textureSampleLevel(tex2D, samp, _e60, 3f); - c_2 = _e62; - let _e67 = coord_5; - let _e71 = textureSampleLevel(tex2D, samp, _e67, 3f, vec2(5i)); - c_2 = _e71; - let _e75 = coord_5; - let _e78 = textureSample(tex2D, samp, _e75, vec2(5i)); - c_2 = _e78; - let _e83 = coord_5; - let _e87 = textureSampleBias(tex2D, samp, _e83, 2f, vec2(5i)); - c_2 = _e87; - let _e88 = coord_5; - let _e93 = coord_5; - let _e97 = vec3(_e93.x, _e93.y, 6f); - let _e102 = textureSample(tex2D, samp, (_e97.xy / vec2(_e97.z))); - c_2 = _e102; - let _e103 = coord_5; - let _e109 = coord_5; - let _e114 = vec4(_e109.x, _e109.y, 0f, 6f); - let _e120 = textureSample(tex2D, samp, (_e114.xyz / vec3(_e114.w)).xy); - c_2 = _e120; - let _e121 = coord_5; - let _e127 = coord_5; - let _e131 = vec3(_e127.x, _e127.y, 6f); - let _e137 = textureSampleBias(tex2D, samp, (_e131.xy / vec2(_e131.z)), 2f); - c_2 = _e137; - let _e138 = coord_5; - let _e145 = coord_5; - let _e150 = vec4(_e145.x, _e145.y, 0f, 6f); - let _e157 = textureSampleBias(tex2D, samp, (_e150.xyz / vec3(_e150.w)).xy, 2f); - c_2 = _e157; - let _e158 = coord_5; - let _e167 = coord_5; - let _e171 = vec3(_e167.x, _e167.y, 6f); - let _e180 = textureSampleGrad(tex2D, samp, (_e171.xy / vec2(_e171.z)), vec2(4f), vec2(4f)); - c_2 = _e180; - let _e181 = coord_5; - let _e191 = coord_5; - let _e196 = vec4(_e191.x, _e191.y, 0f, 6f); - let _e206 = textureSampleGrad(tex2D, samp, (_e196.xyz / vec3(_e196.w)).xy, vec2(4f), vec2(4f)); - c_2 = _e206; - let _e207 = coord_5; - let _e218 = coord_5; - let _e222 = vec3(_e218.x, _e218.y, 6f); - let _e233 = textureSampleGrad(tex2D, samp, (_e222.xy / vec2(_e222.z)), vec2(4f), vec2(4f), vec2(5i)); - c_2 = _e233; - let _e234 = coord_5; - let _e246 = coord_5; - let _e251 = vec4(_e246.x, _e246.y, 0f, 6f); - let _e263 = textureSampleGrad(tex2D, samp, (_e251.xyz / vec3(_e251.w)).xy, vec2(4f), vec2(4f), vec2(5i)); - c_2 = _e263; - let _e264 = coord_5; - let _e270 = coord_5; - let _e274 = vec3(_e270.x, _e270.y, 6f); - let _e280 = textureSampleLevel(tex2D, samp, (_e274.xy / vec2(_e274.z)), 3f); - c_2 = _e280; - let _e281 = coord_5; - let _e288 = coord_5; - let _e293 = vec4(_e288.x, _e288.y, 0f, 6f); - let _e300 = textureSampleLevel(tex2D, samp, (_e293.xyz / vec3(_e293.w)).xy, 3f); - c_2 = _e300; - let _e301 = coord_5; - let _e309 = coord_5; - let _e313 = vec3(_e309.x, _e309.y, 6f); - let _e321 = textureSampleLevel(tex2D, samp, (_e313.xy / vec2(_e313.z)), 3f, vec2(5i)); - c_2 = _e321; - let _e322 = coord_5; - let _e331 = coord_5; - let _e336 = vec4(_e331.x, _e331.y, 0f, 6f); - let _e345 = textureSampleLevel(tex2D, samp, (_e336.xyz / vec3(_e336.w)).xy, 3f, vec2(5i)); - c_2 = _e345; - let _e346 = coord_5; - let _e353 = coord_5; - let _e357 = vec3(_e353.x, _e353.y, 6f); - let _e364 = textureSample(tex2D, samp, (_e357.xy / vec2(_e357.z)), vec2(5i)); - c_2 = _e364; - let _e365 = coord_5; - let _e373 = coord_5; - let _e378 = vec4(_e373.x, _e373.y, 0f, 6f); - let _e386 = textureSample(tex2D, samp, (_e378.xyz / vec3(_e378.w)).xy, vec2(5i)); - c_2 = _e386; - let _e387 = coord_5; - let _e395 = coord_5; - let _e399 = vec3(_e395.x, _e395.y, 6f); - let _e407 = textureSampleBias(tex2D, samp, (_e399.xy / vec2(_e399.z)), 2f, vec2(5i)); - c_2 = _e407; - let _e408 = coord_5; - let _e417 = coord_5; - let _e422 = vec4(_e417.x, _e417.y, 0f, 6f); - let _e431 = textureSampleBias(tex2D, samp, (_e422.xyz / vec3(_e422.w)).xy, 2f, vec2(5i)); - c_2 = _e431; - let _e432 = coord_5; + 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 = textureLoad(tex2D, vec2(_e435), 3i); - c_2 = _e438; - let _e439 = coord_5; - let _e444 = coord_5; - let _e449 = textureLoad(tex2D, vec2(_e444), 3i); - c_2 = _e449; + let _e438 = coord_5; + let _e441 = textureLoad(tex2D, vec2(_e438), 3i); + c_2 = _e441; + let _e442 = coord_5; + let _e447 = coord_5; + let _e452 = textureLoad(tex2D, vec2(_e447), 3i); + c_2 = _e452; return; } fn testTex2DShadow(coord_6: vec2) { var coord_7: vec2; var size2DShadow: vec2; + var levels_3: i32; var d: f32; coord_7 = coord_6; let _e20 = textureDimensions(tex2DShadow, 0i); size2DShadow = vec2(_e20); - let _e24 = coord_7; - let _e29 = coord_7; - let _e33 = vec3(_e29.x, _e29.y, 1f); - let _e36 = textureSampleCompare(tex2DShadow, sampShadow, _e33.xy, _e33.z); - d = _e36; - let _e37 = coord_7; - let _e46 = coord_7; - let _e50 = vec3(_e46.x, _e46.y, 1f); - let _e57 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e50.xy, _e50.z); - d = _e57; - let _e58 = coord_7; - let _e69 = coord_7; - let _e73 = vec3(_e69.x, _e69.y, 1f); - let _e82 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e73.xy, _e73.z, vec2(5i)); - d = _e82; - let _e83 = coord_7; - let _e89 = coord_7; - let _e93 = vec3(_e89.x, _e89.y, 1f); - let _e97 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e93.xy, _e93.z); - d = _e97; - let _e98 = coord_7; - let _e106 = coord_7; - let _e110 = vec3(_e106.x, _e106.y, 1f); - let _e116 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e110.xy, _e110.z, vec2(5i)); - d = _e116; - let _e117 = coord_7; - let _e124 = coord_7; - let _e128 = vec3(_e124.x, _e124.y, 1f); - let _e133 = textureSampleCompare(tex2DShadow, sampShadow, _e128.xy, _e128.z, vec2(5i)); - d = _e133; - let _e134 = coord_7; - let _e140 = coord_7; - let _e145 = vec4(_e140.x, _e140.y, 1f, 6f); - let _e149 = (_e145.xyz / vec3(_e145.w)); - let _e152 = textureSampleCompare(tex2DShadow, sampShadow, _e149.xy, _e149.z); - d = _e152; - let _e153 = coord_7; - let _e163 = coord_7; - let _e168 = vec4(_e163.x, _e163.y, 1f, 6f); - let _e176 = (_e168.xyz / vec3(_e168.w)); - let _e179 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e176.xy, _e176.z); - d = _e179; - let _e180 = coord_7; - let _e192 = coord_7; - let _e197 = vec4(_e192.x, _e192.y, 1f, 6f); - let _e207 = (_e197.xyz / vec3(_e197.w)); - let _e210 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e207.xy, _e207.z, vec2(5i)); - d = _e210; - let _e211 = coord_7; - let _e218 = coord_7; - let _e223 = vec4(_e218.x, _e218.y, 1f, 6f); - let _e228 = (_e223.xyz / vec3(_e223.w)); - let _e231 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e228.xy, _e228.z); - d = _e231; - let _e232 = coord_7; - let _e241 = coord_7; - let _e246 = vec4(_e241.x, _e241.y, 1f, 6f); - let _e253 = (_e246.xyz / vec3(_e246.w)); - let _e256 = textureSampleCompareLevel(tex2DShadow, sampShadow, _e253.xy, _e253.z, vec2(5i)); - d = _e256; - let _e257 = coord_7; - let _e265 = coord_7; - let _e270 = vec4(_e265.x, _e265.y, 1f, 6f); - let _e276 = (_e270.xyz / vec3(_e270.w)); - let _e279 = textureSampleCompare(tex2DShadow, sampShadow, _e276.xy, _e276.z, vec2(5i)); - d = _e279; + 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; return; } fn testTex2DArray(coord_8: vec3) { var coord_9: vec3; var size2DArray: vec3; + var levels_4: i32; 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 _e29 = coord_9; - let _e33 = textureSample(tex2DArray, samp, _e29.xy, i32(_e29.z)); - c_3 = _e33; - let _e36 = coord_9; - let _e41 = textureSampleBias(tex2DArray, samp, _e36.xy, i32(_e36.z), 2f); - c_3 = _e41; - let _e47 = coord_9; - let _e55 = textureSampleGrad(tex2DArray, samp, _e47.xy, i32(_e47.z), vec2(4f), vec2(4f)); - c_3 = _e55; - let _e63 = coord_9; - let _e73 = textureSampleGrad(tex2DArray, samp, _e63.xy, i32(_e63.z), vec2(4f), vec2(4f), vec2(5i)); - c_3 = _e73; - let _e76 = coord_9; - let _e81 = textureSampleLevel(tex2DArray, samp, _e76.xy, i32(_e76.z), 3f); - c_3 = _e81; - let _e86 = coord_9; - let _e93 = textureSampleLevel(tex2DArray, samp, _e86.xy, i32(_e86.z), 3f, vec2(5i)); - c_3 = _e93; - let _e97 = coord_9; - let _e103 = textureSample(tex2DArray, samp, _e97.xy, i32(_e97.z), vec2(5i)); - c_3 = _e103; - let _e108 = coord_9; - let _e115 = textureSampleBias(tex2DArray, samp, _e108.xy, i32(_e108.z), 2f, vec2(5i)); - c_3 = _e115; - let _e116 = coord_9; + 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 _e120 = vec3(_e119); - let _e124 = textureLoad(tex2DArray, _e120.xy, _e120.z, 3i); - c_3 = _e124; - let _e125 = coord_9; - let _e130 = coord_9; - let _e131 = vec3(_e130); - let _e137 = textureLoad(tex2DArray, _e131.xy, _e131.z, 3i); - c_3 = _e137; + 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; return; } fn testTex2DArrayShadow(coord_10: vec3) { var coord_11: vec3; var size2DArrayShadow: vec3; + var levels_5: i32; 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 _e28 = coord_11; - let _e34 = coord_11; - let _e39 = vec4(_e34.x, _e34.y, _e34.z, 1f); - let _e44 = textureSampleCompare(tex2DArrayShadow, sampShadow, _e39.xy, i32(_e39.z), _e39.w); - d_1 = _e44; - let _e45 = coord_11; - let _e55 = coord_11; - let _e60 = vec4(_e55.x, _e55.y, _e55.z, 1f); - let _e69 = textureSampleCompareLevel(tex2DArrayShadow, sampShadow, _e60.xy, i32(_e60.z), _e60.w); - d_1 = _e69; - let _e70 = coord_11; - let _e82 = coord_11; - let _e87 = vec4(_e82.x, _e82.y, _e82.z, 1f); - let _e98 = textureSampleCompareLevel(tex2DArrayShadow, sampShadow, _e87.xy, i32(_e87.z), _e87.w, vec2(5i)); - d_1 = _e98; - let _e99 = coord_11; - let _e107 = coord_11; - let _e112 = vec4(_e107.x, _e107.y, _e107.z, 1f); - let _e119 = textureSampleCompare(tex2DArrayShadow, sampShadow, _e112.xy, i32(_e112.z), _e112.w, vec2(5i)); - d_1 = _e119; + 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; return; } fn testTexCube(coord_12: vec3) { var coord_13: vec3; var sizeCube: vec2; + var levels_6: i32; var c_4: vec4; coord_13 = coord_12; let _e20 = textureDimensions(texCube, 0i); sizeCube = vec2(_e20); - let _e25 = coord_13; - let _e26 = textureSample(texCube, samp, _e25); - c_4 = _e26; - let _e29 = coord_13; - let _e31 = textureSampleBias(texCube, samp, _e29, 2f); - c_4 = _e31; - let _e37 = coord_13; - let _e42 = textureSampleGrad(texCube, samp, _e37, vec3(4f), vec3(4f)); - c_4 = _e42; - let _e45 = coord_13; - let _e47 = textureSampleLevel(texCube, samp, _e45, 3f); - c_4 = _e47; + 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; return; } fn testTexCubeShadow(coord_14: vec3) { var coord_15: vec3; var sizeCubeShadow: vec2; + var levels_7: i32; var d_2: f32; coord_15 = coord_14; let _e20 = textureDimensions(texCubeShadow, 0i); sizeCubeShadow = vec2(_e20); - let _e24 = coord_15; - let _e30 = coord_15; - let _e35 = vec4(_e30.x, _e30.y, _e30.z, 1f); - let _e38 = textureSampleCompare(texCubeShadow, sampShadow, _e35.xyz, _e35.w); - d_2 = _e38; - let _e39 = coord_15; - let _e49 = coord_15; - let _e54 = vec4(_e49.x, _e49.y, _e49.z, 1f); - let _e61 = textureSampleCompareLevel(texCubeShadow, sampShadow, _e54.xyz, _e54.w); - d_2 = _e61; + 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; return; } fn testTexCubeArray(coord_16: vec4) { var coord_17: vec4; var sizeCubeArray: vec3; + var levels_8: i32; 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 _e29 = coord_17; - let _e33 = textureSample(texCubeArray, samp, _e29.xyz, i32(_e29.w)); - c_5 = _e33; - let _e36 = coord_17; - let _e41 = textureSampleBias(texCubeArray, samp, _e36.xyz, i32(_e36.w), 2f); - c_5 = _e41; - let _e47 = coord_17; - let _e55 = textureSampleGrad(texCubeArray, samp, _e47.xyz, i32(_e47.w), vec3(4f), vec3(4f)); - c_5 = _e55; - let _e58 = coord_17; - let _e63 = textureSampleLevel(texCubeArray, samp, _e58.xyz, i32(_e58.w), 3f); - c_5 = _e63; + 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; return; } fn testTexCubeArrayShadow(coord_18: vec4) { var coord_19: vec4; var sizeCubeArrayShadow: vec3; + var levels_9: i32; 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 _e30 = coord_19; - let _e35 = textureSampleCompare(texCubeArrayShadow, sampShadow, _e30.xyz, i32(_e30.w), 1f); - d_3 = _e35; + 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; return; } fn testTex3D(coord_20: vec3) { var coord_21: vec3; var size3D: vec3; + var levels_10: i32; var c_6: vec4; coord_21 = coord_20; let _e20 = textureDimensions(tex3D, 0i); size3D = vec3(_e20); - let _e25 = coord_21; - let _e26 = textureSample(tex3D, samp, _e25); - c_6 = _e26; - let _e29 = coord_21; - let _e31 = textureSampleBias(tex3D, samp, _e29, 2f); - c_6 = _e31; + 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 _e38 = coord_21; - let _e43 = vec4(_e38.x, _e38.y, _e38.z, 6f); - let _e48 = textureSample(tex3D, samp, (_e43.xyz / vec3(_e43.w))); - c_6 = _e48; - let _e49 = coord_21; - let _e56 = coord_21; - let _e61 = vec4(_e56.x, _e56.y, _e56.z, 6f); - let _e67 = textureSampleBias(tex3D, samp, (_e61.xyz / vec3(_e61.w)), 2f); - c_6 = _e67; - let _e68 = coord_21; - let _e76 = coord_21; - let _e81 = vec4(_e76.x, _e76.y, _e76.z, 6f); - let _e88 = textureSample(tex3D, samp, (_e81.xyz / vec3(_e81.w)), vec3(5i)); - c_6 = _e88; - let _e89 = coord_21; - let _e98 = coord_21; - let _e103 = vec4(_e98.x, _e98.y, _e98.z, 6f); - let _e111 = textureSampleBias(tex3D, samp, (_e103.xyz / vec3(_e103.w)), 2f, vec3(5i)); - c_6 = _e111; - let _e112 = coord_21; - let _e119 = coord_21; - let _e124 = vec4(_e119.x, _e119.y, _e119.z, 6f); - let _e130 = textureSampleLevel(tex3D, samp, (_e124.xyz / vec3(_e124.w)), 3f); - c_6 = _e130; - let _e131 = coord_21; - let _e140 = coord_21; - let _e145 = vec4(_e140.x, _e140.y, _e140.z, 6f); - let _e153 = textureSampleLevel(tex3D, samp, (_e145.xyz / vec3(_e145.w)), 3f, vec3(5i)); - c_6 = _e153; - let _e154 = coord_21; - let _e164 = coord_21; - let _e169 = vec4(_e164.x, _e164.y, _e164.z, 6f); - let _e178 = textureSampleGrad(tex3D, samp, (_e169.xyz / vec3(_e169.w)), vec3(4f), vec3(4f)); - c_6 = _e178; - let _e179 = coord_21; - let _e191 = coord_21; - let _e196 = vec4(_e191.x, _e191.y, _e191.z, 6f); - let _e207 = textureSampleGrad(tex3D, samp, (_e196.xyz / vec3(_e196.w)), vec3(4f), vec3(4f), vec3(5i)); - c_6 = _e207; - let _e213 = coord_21; - let _e218 = textureSampleGrad(tex3D, samp, _e213, vec3(4f), vec3(4f)); - c_6 = _e218; - let _e226 = coord_21; - let _e233 = textureSampleGrad(tex3D, samp, _e226, vec3(4f), vec3(4f), vec3(5i)); - c_6 = _e233; - let _e236 = coord_21; - let _e238 = textureSampleLevel(tex3D, samp, _e236, 3f); - c_6 = _e238; - let _e243 = coord_21; - let _e247 = textureSampleLevel(tex3D, samp, _e243, 3f, vec3(5i)); - c_6 = _e247; - let _e251 = coord_21; - let _e254 = textureSample(tex3D, samp, _e251, vec3(5i)); - c_6 = _e254; - let _e259 = coord_21; - let _e263 = textureSampleBias(tex3D, samp, _e259, 2f, vec3(5i)); - c_6 = _e263; - let _e264 = 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 = textureLoad(tex3D, vec3(_e267), 3i); - c_6 = _e270; - let _e271 = coord_21; - let _e276 = coord_21; - let _e281 = textureLoad(tex3D, vec3(_e276), 3i); - c_6 = _e281; + 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; return; }