Files
wgpu/naga/tests/out/spv/image.spvasm
Samson 424fde1622 [naga] Support local const in ImageSample.offset (#7213)
* [naga] Support local const in ImageSample.offset

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Update test expect

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Update test

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Update test expect

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Remove docs about ImageSample.offset refering to global expr

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-03-07 19:56:08 +01:00

1059 lines
34 KiB
Plaintext

; SPIR-V
; Version: 1.1
; Generator: rspirv
; Bound: 547
OpCapability Shader
OpCapability Image1D
OpCapability Sampled1D
OpCapability SampledCubeArray
OpCapability ImageQuery
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %96 "main" %93
OpEntryPoint GLCompute %190 "depth_load" %188
OpEntryPoint Vertex %210 "queries" %208
OpEntryPoint Vertex %262 "levels_queries" %261
OpEntryPoint Fragment %293 "texture_sample" %292
OpEntryPoint Fragment %440 "texture_sample_comparison" %438
OpEntryPoint Fragment %496 "gather" %495
OpEntryPoint Fragment %530 "depth_no_comparison" %529
OpExecutionMode %96 LocalSize 16 1 1
OpExecutionMode %190 LocalSize 16 1 1
OpExecutionMode %293 OriginUpperLeft
OpExecutionMode %440 OriginUpperLeft
OpExecutionMode %496 OriginUpperLeft
OpExecutionMode %530 OriginUpperLeft
%3 = OpString "image.wgsl"
OpSource Unknown 0 %3 "@group(0) @binding(0)
var image_mipmapped_src: texture_2d<u32>;
@group(0) @binding(3)
var image_multisampled_src: texture_multisampled_2d<u32>;
@group(0) @binding(4)
var image_depth_multisampled_src: texture_depth_multisampled_2d;
@group(0) @binding(1)
var image_storage_src: texture_storage_2d<rgba8uint, read>;
@group(0) @binding(5)
var image_array_src: texture_2d_array<u32>;
@group(0) @binding(6)
var image_dup_src: texture_storage_1d<r32uint,read>; // for #1307
@group(0) @binding(7)
var image_1d_src: texture_1d<u32>;
@group(0) @binding(2)
var image_dst: texture_storage_1d<r32uint,write>;
@compute @workgroup_size(16)
fn main(@builtin(local_invocation_id) local_id: vec3<u32>) {
let dim = textureDimensions(image_storage_src);
let itc = vec2<i32>(dim * local_id.xy) % vec2<i32>(10, 20);
// loads with ivec2 coords.
let value1 = textureLoad(image_mipmapped_src, itc, i32(local_id.z));
// doing the same thing as the line above, but with u32, as textureLoad must also support unsigned integers.
let value1_2 = textureLoad(image_mipmapped_src, itc, u32(local_id.z));
let value2 = textureLoad(image_multisampled_src, itc, i32(local_id.z));
let value4 = textureLoad(image_storage_src, itc);
let value5 = textureLoad(image_array_src, itc, local_id.z, i32(local_id.z) + 1);
let value6 = textureLoad(image_array_src, itc, i32(local_id.z), i32(local_id.z) + 1);
let value7 = textureLoad(image_1d_src, i32(local_id.x), i32(local_id.z));
// loads with uvec2 coords.
let value1u = textureLoad(image_mipmapped_src, vec2<u32>(itc), i32(local_id.z));
let value2u = textureLoad(image_multisampled_src, vec2<u32>(itc), i32(local_id.z));
let value4u = textureLoad(image_storage_src, vec2<u32>(itc));
let value5u = textureLoad(image_array_src, vec2<u32>(itc), local_id.z, i32(local_id.z) + 1);
let value6u = textureLoad(image_array_src, vec2<u32>(itc), i32(local_id.z), i32(local_id.z) + 1);
let value7u = textureLoad(image_1d_src, u32(local_id.x), i32(local_id.z));
// store with ivec2 coords.
textureStore(image_dst, itc.x, value1 + value2 + value4 + value5 + value6);
// store with uvec2 coords.
textureStore(image_dst, u32(itc.x), value1u + value2u + value4u + value5u + value6u);
}
@compute @workgroup_size(16, 1, 1)
fn depth_load(@builtin(local_invocation_id) local_id: vec3<u32>) {
let dim: vec2<u32> = textureDimensions(image_storage_src);
let itc: vec2<i32> = (vec2<i32>(dim * local_id.xy) % vec2<i32>(10, 20));
let val: f32 = textureLoad(image_depth_multisampled_src, itc, i32(local_id.z));
textureStore(image_dst, itc.x, vec4<u32>(u32(val)));
return;
}
@group(0) @binding(0)
var image_1d: texture_1d<f32>;
@group(0) @binding(1)
var image_2d: texture_2d<f32>;
@group(0) @binding(2)
var image_2d_u32: texture_2d<u32>;
@group(0) @binding(3)
var image_2d_i32: texture_2d<i32>;
@group(0) @binding(4)
var image_2d_array: texture_2d_array<f32>;
@group(0) @binding(5)
var image_cube: texture_cube<f32>;
@group(0) @binding(6)
var image_cube_array: texture_cube_array<f32>;
@group(0) @binding(7)
var image_3d: texture_3d<f32>;
@group(0) @binding(8)
var image_aa: texture_multisampled_2d<f32>;
@vertex
fn queries() -> @builtin(position) vec4<f32> {
let dim_1d = textureDimensions(image_1d);
let dim_1d_lod = textureDimensions(image_1d, i32(dim_1d));
let dim_2d = textureDimensions(image_2d);
let dim_2d_lod = textureDimensions(image_2d, 1);
let dim_2d_array = textureDimensions(image_2d_array);
let dim_2d_array_lod = textureDimensions(image_2d_array, 1);
let dim_cube = textureDimensions(image_cube);
let dim_cube_lod = textureDimensions(image_cube, 1);
let dim_cube_array = textureDimensions(image_cube_array);
let dim_cube_array_lod = textureDimensions(image_cube_array, 1);
let dim_3d = textureDimensions(image_3d);
let dim_3d_lod = textureDimensions(image_3d, 1);
let dim_2s_ms = textureDimensions(image_aa);
let sum = dim_1d + dim_2d.y + dim_2d_lod.y + dim_2d_array.y + dim_2d_array_lod.y +
dim_cube.y + dim_cube_lod.y + dim_cube_array.y + dim_cube_array_lod.y +
dim_3d.z + dim_3d_lod.z;
return vec4<f32>(f32(sum));
}
@vertex
fn levels_queries() -> @builtin(position) vec4<f32> {
let num_levels_2d = textureNumLevels(image_2d);
let num_layers_2d = textureNumLayers(image_2d_array);
let num_levels_2d_array = textureNumLevels(image_2d_array);
let num_layers_2d_array = textureNumLayers(image_2d_array);
let num_levels_cube = textureNumLevels(image_cube);
let num_levels_cube_array = textureNumLevels(image_cube_array);
let num_layers_cube = textureNumLayers(image_cube_array);
let num_levels_3d = textureNumLevels(image_3d);
let num_samples_aa = textureNumSamples(image_aa);
let sum = num_layers_2d + num_layers_cube + num_samples_aa +
num_levels_2d + num_levels_2d_array + num_levels_3d + num_levels_cube + num_levels_cube_array;
return vec4<f32>(f32(sum));
}
@group(1) @binding(0)
var sampler_reg: sampler;
@fragment
fn texture_sample() -> @location(0) vec4<f32> {
const tc = vec2<f32>(0.5);
const tc3 = vec3<f32>(0.5);
const offset = vec2<i32>(3, 1);
let level = 2.3;
var a: vec4<f32>;
a += textureSample(image_1d, sampler_reg, tc.x);
a += textureSample(image_2d, sampler_reg, tc);
a += textureSample(image_2d, sampler_reg, tc, vec2<i32>(3, 1));
a += textureSampleLevel(image_2d, sampler_reg, tc, level);
a += textureSampleLevel(image_2d, sampler_reg, tc, level, offset);
a += textureSampleBias(image_2d, sampler_reg, tc, 2.0, offset);
a += textureSample(image_2d_array, sampler_reg, tc, 0u);
a += textureSample(image_2d_array, sampler_reg, tc, 0u, offset);
a += textureSampleLevel(image_2d_array, sampler_reg, tc, 0u, level);
a += textureSampleLevel(image_2d_array, sampler_reg, tc, 0u, level, offset);
a += textureSampleBias(image_2d_array, sampler_reg, tc, 0u, 2.0, offset);
a += textureSample(image_2d_array, sampler_reg, tc, 0);
a += textureSample(image_2d_array, sampler_reg, tc, 0, offset);
a += textureSampleLevel(image_2d_array, sampler_reg, tc, 0, level);
a += textureSampleLevel(image_2d_array, sampler_reg, tc, 0, level, offset);
a += textureSampleBias(image_2d_array, sampler_reg, tc, 0, 2.0, offset);
a += textureSample(image_cube_array, sampler_reg, tc3, 0u);
a += textureSampleLevel(image_cube_array, sampler_reg, tc3, 0u, level);
a += textureSampleBias(image_cube_array, sampler_reg, tc3, 0u, 2.0);
a += textureSample(image_cube_array, sampler_reg, tc3, 0);
a += textureSampleLevel(image_cube_array, sampler_reg, tc3, 0, level);
a += textureSampleBias(image_cube_array, sampler_reg, tc3, 0, 2.0);
return a;
}
@group(1) @binding(1)
var sampler_cmp: sampler_comparison;
@group(1) @binding(2)
var image_2d_depth: texture_depth_2d;
@group(1) @binding(3)
var image_2d_array_depth: texture_depth_2d_array;
@group(1) @binding(4)
var image_cube_depth: texture_depth_cube;
@fragment
fn texture_sample_comparison() -> @location(0) f32 {
let tc = vec2<f32>(0.5);
let tc3 = vec3<f32>(0.5);
let dref = 0.5;
var a: f32;
a += textureSampleCompare(image_2d_depth, sampler_cmp, tc, dref);
a += textureSampleCompare(image_2d_array_depth, sampler_cmp, tc, 0u, dref);
a += textureSampleCompare(image_2d_array_depth, sampler_cmp, tc, 0, dref);
a += textureSampleCompare(image_cube_depth, sampler_cmp, tc3, dref);
a += textureSampleCompareLevel(image_2d_depth, sampler_cmp, tc, dref);
a += textureSampleCompareLevel(image_2d_array_depth, sampler_cmp, tc, 0u, dref);
a += textureSampleCompareLevel(image_2d_array_depth, sampler_cmp, tc, 0, dref);
a += textureSampleCompareLevel(image_cube_depth, sampler_cmp, tc3, dref);
return a;
}
@fragment
fn gather() -> @location(0) vec4<f32> {
let tc = vec2<f32>(0.5);
let dref = 0.5;
let s2d = textureGather(1, image_2d, sampler_reg, tc);
let s2d_offset = textureGather(3, image_2d, sampler_reg, tc, vec2<i32>(3, 1));
let s2d_depth = textureGatherCompare(image_2d_depth, sampler_cmp, tc, dref);
let s2d_depth_offset = textureGatherCompare(image_2d_depth, sampler_cmp, tc, dref, vec2<i32>(3, 1));
let u = textureGather(0, image_2d_u32, sampler_reg, tc);
let i = textureGather(0, image_2d_i32, sampler_reg, tc);
let f = vec4<f32>(u) + vec4<f32>(i);
return s2d + s2d_offset + s2d_depth + s2d_depth_offset + f;
}
@fragment
fn depth_no_comparison() -> @location(0) vec4<f32> {
let tc = vec2<f32>(0.5);
let level = 1;
let s2d = textureSample(image_2d_depth, sampler_reg, tc);
let s2d_gather = textureGather(image_2d_depth, sampler_reg, tc);
let s2d_level = textureSampleLevel(image_2d_depth, sampler_reg, tc, level);
return s2d + s2d_gather + s2d_level;
}
"
OpName %29 "image_mipmapped_src"
OpName %31 "image_multisampled_src"
OpName %33 "image_depth_multisampled_src"
OpName %35 "image_storage_src"
OpName %37 "image_array_src"
OpName %39 "image_dup_src"
OpName %41 "image_1d_src"
OpName %43 "image_dst"
OpName %44 "image_1d"
OpName %46 "image_2d"
OpName %48 "image_2d_u32"
OpName %49 "image_2d_i32"
OpName %51 "image_2d_array"
OpName %53 "image_cube"
OpName %55 "image_cube_array"
OpName %57 "image_3d"
OpName %59 "image_aa"
OpName %61 "sampler_reg"
OpName %63 "sampler_cmp"
OpName %64 "image_2d_depth"
OpName %66 "image_2d_array_depth"
OpName %68 "image_cube_depth"
OpName %70 "naga_mod"
OpName %72 "lhs"
OpName %73 "rhs"
OpName %93 "local_id"
OpName %96 "main"
OpName %188 "local_id"
OpName %190 "depth_load"
OpName %210 "queries"
OpName %262 "levels_queries"
OpName %293 "texture_sample"
OpName %308 "a"
OpName %440 "texture_sample_comparison"
OpName %445 "a"
OpName %496 "gather"
OpName %530 "depth_no_comparison"
OpDecorate %29 DescriptorSet 0
OpDecorate %29 Binding 0
OpDecorate %31 DescriptorSet 0
OpDecorate %31 Binding 3
OpDecorate %33 DescriptorSet 0
OpDecorate %33 Binding 4
OpDecorate %35 NonWritable
OpDecorate %35 DescriptorSet 0
OpDecorate %35 Binding 1
OpDecorate %37 DescriptorSet 0
OpDecorate %37 Binding 5
OpDecorate %39 NonWritable
OpDecorate %39 DescriptorSet 0
OpDecorate %39 Binding 6
OpDecorate %41 DescriptorSet 0
OpDecorate %41 Binding 7
OpDecorate %43 NonReadable
OpDecorate %43 DescriptorSet 0
OpDecorate %43 Binding 2
OpDecorate %44 DescriptorSet 0
OpDecorate %44 Binding 0
OpDecorate %46 DescriptorSet 0
OpDecorate %46 Binding 1
OpDecorate %48 DescriptorSet 0
OpDecorate %48 Binding 2
OpDecorate %49 DescriptorSet 0
OpDecorate %49 Binding 3
OpDecorate %51 DescriptorSet 0
OpDecorate %51 Binding 4
OpDecorate %53 DescriptorSet 0
OpDecorate %53 Binding 5
OpDecorate %55 DescriptorSet 0
OpDecorate %55 Binding 6
OpDecorate %57 DescriptorSet 0
OpDecorate %57 Binding 7
OpDecorate %59 DescriptorSet 0
OpDecorate %59 Binding 8
OpDecorate %61 DescriptorSet 1
OpDecorate %61 Binding 0
OpDecorate %63 DescriptorSet 1
OpDecorate %63 Binding 1
OpDecorate %64 DescriptorSet 1
OpDecorate %64 Binding 2
OpDecorate %66 DescriptorSet 1
OpDecorate %66 Binding 3
OpDecorate %68 DescriptorSet 1
OpDecorate %68 Binding 4
OpDecorate %93 BuiltIn LocalInvocationId
OpDecorate %188 BuiltIn LocalInvocationId
OpDecorate %208 BuiltIn Position
OpDecorate %261 BuiltIn Position
OpDecorate %292 Location 0
OpDecorate %438 Location 0
OpDecorate %495 Location 0
OpDecorate %529 Location 0
%2 = OpTypeVoid
%5 = OpTypeInt 32 0
%4 = OpTypeImage %5 2D 0 0 0 1 Unknown
%6 = OpTypeImage %5 2D 0 0 1 1 Unknown
%8 = OpTypeFloat 32
%7 = OpTypeImage %8 2D 1 0 1 1 Unknown
%9 = OpTypeImage %5 2D 0 0 0 2 Rgba8ui
%10 = OpTypeImage %5 2D 0 1 0 1 Unknown
%11 = OpTypeImage %5 1D 0 0 0 2 R32ui
%12 = OpTypeImage %5 1D 0 0 0 1 Unknown
%13 = OpTypeVector %5 3
%15 = OpTypeInt 32 1
%14 = OpTypeVector %15 2
%16 = OpTypeImage %8 1D 0 0 0 1 Unknown
%17 = OpTypeImage %8 2D 0 0 0 1 Unknown
%18 = OpTypeImage %15 2D 0 0 0 1 Unknown
%19 = OpTypeImage %8 2D 0 1 0 1 Unknown
%20 = OpTypeImage %8 Cube 0 0 0 1 Unknown
%21 = OpTypeImage %8 Cube 0 1 0 1 Unknown
%22 = OpTypeImage %8 3D 0 0 0 1 Unknown
%23 = OpTypeImage %8 2D 0 0 1 1 Unknown
%24 = OpTypeVector %8 4
%25 = OpTypeSampler
%26 = OpTypeImage %8 2D 1 0 0 1 Unknown
%27 = OpTypeImage %8 2D 1 1 0 1 Unknown
%28 = OpTypeImage %8 Cube 1 0 0 1 Unknown
%30 = OpTypePointer UniformConstant %4
%29 = OpVariable %30 UniformConstant
%32 = OpTypePointer UniformConstant %6
%31 = OpVariable %32 UniformConstant
%34 = OpTypePointer UniformConstant %7
%33 = OpVariable %34 UniformConstant
%36 = OpTypePointer UniformConstant %9
%35 = OpVariable %36 UniformConstant
%38 = OpTypePointer UniformConstant %10
%37 = OpVariable %38 UniformConstant
%40 = OpTypePointer UniformConstant %11
%39 = OpVariable %40 UniformConstant
%42 = OpTypePointer UniformConstant %12
%41 = OpVariable %42 UniformConstant
%43 = OpVariable %40 UniformConstant
%45 = OpTypePointer UniformConstant %16
%44 = OpVariable %45 UniformConstant
%47 = OpTypePointer UniformConstant %17
%46 = OpVariable %47 UniformConstant
%48 = OpVariable %30 UniformConstant
%50 = OpTypePointer UniformConstant %18
%49 = OpVariable %50 UniformConstant
%52 = OpTypePointer UniformConstant %19
%51 = OpVariable %52 UniformConstant
%54 = OpTypePointer UniformConstant %20
%53 = OpVariable %54 UniformConstant
%56 = OpTypePointer UniformConstant %21
%55 = OpVariable %56 UniformConstant
%58 = OpTypePointer UniformConstant %22
%57 = OpVariable %58 UniformConstant
%60 = OpTypePointer UniformConstant %23
%59 = OpVariable %60 UniformConstant
%62 = OpTypePointer UniformConstant %25
%61 = OpVariable %62 UniformConstant
%63 = OpVariable %62 UniformConstant
%65 = OpTypePointer UniformConstant %26
%64 = OpVariable %65 UniformConstant
%67 = OpTypePointer UniformConstant %27
%66 = OpVariable %67 UniformConstant
%69 = OpTypePointer UniformConstant %28
%68 = OpVariable %69 UniformConstant
%71 = OpTypeFunction %14 %14 %14
%76 = OpTypeBool
%75 = OpTypeVector %76 2
%77 = OpConstant %15 0
%78 = OpConstantComposite %14 %77 %77
%80 = OpConstant %15 -2147483648
%81 = OpConstant %15 -1
%82 = OpConstantComposite %14 %80 %80
%83 = OpConstantComposite %14 %81 %81
%88 = OpConstant %15 1
%89 = OpConstantComposite %14 %88 %88
%94 = OpTypePointer Input %13
%93 = OpVariable %94 Input
%97 = OpTypeFunction %2
%104 = OpConstant %15 10
%105 = OpConstant %15 20
%106 = OpConstantComposite %14 %104 %105
%108 = OpTypeVector %5 2
%116 = OpTypeVector %5 4
%130 = OpTypeVector %15 3
%188 = OpVariable %94 Input
%209 = OpTypePointer Output %24
%208 = OpVariable %209 Output
%219 = OpConstant %5 0
%261 = OpVariable %209 Output
%292 = OpVariable %209 Output
%299 = OpConstant %8 0.5
%300 = OpTypeVector %8 2
%301 = OpConstantComposite %300 %299 %299
%302 = OpTypeVector %8 3
%303 = OpConstantComposite %302 %299 %299 %299
%304 = OpConstant %15 3
%305 = OpConstantComposite %14 %304 %88
%306 = OpConstant %8 2.3
%307 = OpConstant %8 2.0
%309 = OpTypePointer Function %24
%310 = OpConstantNull %24
%312 = OpTypeSampledImage %16
%317 = OpTypeSampledImage %17
%338 = OpTypeSampledImage %19
%399 = OpTypeSampledImage %21
%439 = OpTypePointer Output %8
%438 = OpVariable %439 Output
%446 = OpTypePointer Function %8
%447 = OpConstantNull %8
%449 = OpTypeSampledImage %26
%454 = OpTypeSampledImage %27
%467 = OpTypeSampledImage %28
%474 = OpConstant %8 0.0
%495 = OpVariable %209 Output
%506 = OpConstant %5 1
%509 = OpConstant %5 3
%514 = OpTypeSampledImage %4
%517 = OpTypeVector %15 4
%518 = OpTypeSampledImage %18
%529 = OpVariable %209 Output
%70 = OpFunction %14 None %71
%72 = OpFunctionParameter %14
%73 = OpFunctionParameter %14
%74 = OpLabel
%79 = OpIEqual %75 %73 %78
%84 = OpIEqual %75 %72 %82
%85 = OpIEqual %75 %73 %83
%86 = OpLogicalAnd %75 %84 %85
%87 = OpLogicalOr %75 %79 %86
%90 = OpSelect %14 %87 %89 %73
%91 = OpSRem %14 %72 %90
OpReturnValue %91
OpFunctionEnd
%96 = OpFunction %2 None %97
%92 = OpLabel
%95 = OpLoad %13 %93
%98 = OpLoad %4 %29
%99 = OpLoad %6 %31
%100 = OpLoad %9 %35
%101 = OpLoad %10 %37
%102 = OpLoad %12 %41
%103 = OpLoad %11 %43
OpBranch %107
%107 = OpLabel
OpLine %3 20 15
%109 = OpImageQuerySize %108 %100
OpLine %3 21 15
%110 = OpVectorShuffle %108 %95 %95 0 1
%111 = OpIMul %108 %109 %110
%112 = OpBitcast %14 %111
OpLine %3 21 15
%113 = OpFunctionCall %14 %70 %112 %106
OpLine %3 23 18
%114 = OpCompositeExtract %5 %95 2
%115 = OpBitcast %15 %114
%117 = OpImageFetch %116 %98 %113 Lod %115
OpLine %3 25 20
%118 = OpCompositeExtract %5 %95 2
%120 = OpImageFetch %116 %98 %113 Lod %118
OpLine %3 26 18
%121 = OpCompositeExtract %5 %95 2
%122 = OpBitcast %15 %121
%123 = OpImageFetch %116 %99 %113 Sample %122
OpLine %3 27 18
%124 = OpImageRead %116 %100 %113
OpLine %3 28 52
%125 = OpCompositeExtract %5 %95 2
%126 = OpCompositeExtract %5 %95 2
%127 = OpBitcast %15 %126
OpLine %3 28 18
%128 = OpIAdd %15 %127 %88
%129 = OpBitcast %15 %125
%131 = OpCompositeConstruct %130 %113 %129
%132 = OpImageFetch %116 %101 %131 Lod %128
OpLine %3 29 52
%133 = OpCompositeExtract %5 %95 2
%134 = OpBitcast %15 %133
%135 = OpCompositeExtract %5 %95 2
%136 = OpBitcast %15 %135
OpLine %3 29 18
%137 = OpIAdd %15 %136 %88
%138 = OpCompositeConstruct %130 %113 %134
%139 = OpImageFetch %116 %101 %138 Lod %137
OpLine %3 30 18
%140 = OpCompositeExtract %5 %95 0
%141 = OpBitcast %15 %140
%142 = OpCompositeExtract %5 %95 2
%143 = OpBitcast %15 %142
%144 = OpImageFetch %116 %102 %141 Lod %143
OpLine %3 32 19
%145 = OpBitcast %108 %113
%146 = OpCompositeExtract %5 %95 2
%147 = OpBitcast %15 %146
%148 = OpImageFetch %116 %98 %145 Lod %147
OpLine %3 33 19
%149 = OpBitcast %108 %113
%150 = OpCompositeExtract %5 %95 2
%151 = OpBitcast %15 %150
%152 = OpImageFetch %116 %99 %149 Sample %151
OpLine %3 34 19
%153 = OpBitcast %108 %113
%154 = OpImageRead %116 %100 %153
OpLine %3 35 48
%155 = OpBitcast %108 %113
%156 = OpCompositeExtract %5 %95 2
%157 = OpCompositeExtract %5 %95 2
%158 = OpBitcast %15 %157
OpLine %3 35 19
%159 = OpIAdd %15 %158 %88
%160 = OpCompositeConstruct %13 %155 %156
%161 = OpImageFetch %116 %101 %160 Lod %159
OpLine %3 36 48
%162 = OpBitcast %108 %113
%163 = OpCompositeExtract %5 %95 2
%164 = OpBitcast %15 %163
%165 = OpCompositeExtract %5 %95 2
%166 = OpBitcast %15 %165
OpLine %3 36 19
%167 = OpIAdd %15 %166 %88
%168 = OpBitcast %5 %164
%169 = OpCompositeConstruct %13 %162 %168
%170 = OpImageFetch %116 %101 %169 Lod %167
OpLine %3 37 19
%171 = OpCompositeExtract %5 %95 0
%173 = OpCompositeExtract %5 %95 2
%174 = OpBitcast %15 %173
%175 = OpImageFetch %116 %102 %171 Lod %174
OpLine %3 39 29
%176 = OpCompositeExtract %15 %113 0
%177 = OpIAdd %116 %117 %123
%178 = OpIAdd %116 %177 %124
%179 = OpIAdd %116 %178 %132
%180 = OpIAdd %116 %179 %139
OpLine %3 39 5
OpImageWrite %103 %176 %180
OpLine %3 41 29
%181 = OpCompositeExtract %15 %113 0
%182 = OpBitcast %5 %181
%183 = OpIAdd %116 %148 %152
%184 = OpIAdd %116 %183 %154
%185 = OpIAdd %116 %184 %161
%186 = OpIAdd %116 %185 %170
OpLine %3 41 5
OpImageWrite %103 %182 %186
OpReturn
OpFunctionEnd
%190 = OpFunction %2 None %97
%187 = OpLabel
%189 = OpLoad %13 %188
%191 = OpLoad %7 %33
%192 = OpLoad %9 %35
%193 = OpLoad %11 %43
OpBranch %194
%194 = OpLabel
OpLine %3 46 26
%195 = OpImageQuerySize %108 %192
OpLine %3 47 27
%196 = OpVectorShuffle %108 %189 %189 0 1
%197 = OpIMul %108 %195 %196
%198 = OpBitcast %14 %197
OpLine %3 47 27
%199 = OpFunctionCall %14 %70 %198 %106
OpLine %3 48 20
%200 = OpCompositeExtract %5 %189 2
%201 = OpBitcast %15 %200
%202 = OpImageFetch %24 %191 %199 Sample %201
%203 = OpCompositeExtract %8 %202 0
OpLine %3 49 29
%204 = OpCompositeExtract %15 %199 0
%205 = OpConvertFToU %5 %203
%206 = OpCompositeConstruct %116 %205 %205 %205 %205
OpLine %3 49 5
OpImageWrite %193 %204 %206
OpReturn
OpFunctionEnd
%210 = OpFunction %2 None %97
%207 = OpLabel
%211 = OpLoad %16 %44
%212 = OpLoad %17 %46
%213 = OpLoad %19 %51
%214 = OpLoad %20 %53
%215 = OpLoad %21 %55
%216 = OpLoad %22 %57
%217 = OpLoad %23 %59
OpBranch %218
%218 = OpLabel
OpLine %3 74 18
%220 = OpImageQuerySizeLod %5 %211 %219
OpLine %3 75 22
%221 = OpBitcast %15 %220
%222 = OpImageQuerySizeLod %5 %211 %221
OpLine %3 76 18
%223 = OpImageQuerySizeLod %108 %212 %219
OpLine %3 77 22
%224 = OpImageQuerySizeLod %108 %212 %88
OpLine %3 78 24
%225 = OpImageQuerySizeLod %13 %213 %219
%226 = OpVectorShuffle %108 %225 %225 0 1
OpLine %3 79 28
%227 = OpImageQuerySizeLod %13 %213 %88
%228 = OpVectorShuffle %108 %227 %227 0 1
OpLine %3 80 20
%229 = OpImageQuerySizeLod %108 %214 %219
OpLine %3 81 24
%230 = OpImageQuerySizeLod %108 %214 %88
OpLine %3 82 26
%231 = OpImageQuerySizeLod %13 %215 %219
%232 = OpVectorShuffle %108 %231 %231 0 0
OpLine %3 83 30
%233 = OpImageQuerySizeLod %13 %215 %88
%234 = OpVectorShuffle %108 %233 %233 0 0
OpLine %3 84 18
%235 = OpImageQuerySizeLod %13 %216 %219
OpLine %3 85 22
%236 = OpImageQuerySizeLod %13 %216 %88
OpLine %3 86 21
%237 = OpImageQuerySize %108 %217
OpLine %3 88 15
%238 = OpCompositeExtract %5 %223 1
%239 = OpIAdd %5 %220 %238
%240 = OpCompositeExtract %5 %224 1
%241 = OpIAdd %5 %239 %240
%242 = OpCompositeExtract %5 %226 1
%243 = OpIAdd %5 %241 %242
%244 = OpCompositeExtract %5 %228 1
%245 = OpIAdd %5 %243 %244
%246 = OpCompositeExtract %5 %229 1
%247 = OpIAdd %5 %245 %246
%248 = OpCompositeExtract %5 %230 1
%249 = OpIAdd %5 %247 %248
%250 = OpCompositeExtract %5 %232 1
%251 = OpIAdd %5 %249 %250
%252 = OpCompositeExtract %5 %234 1
%253 = OpIAdd %5 %251 %252
%254 = OpCompositeExtract %5 %235 2
%255 = OpIAdd %5 %253 %254
%256 = OpCompositeExtract %5 %236 2
%257 = OpIAdd %5 %255 %256
OpLine %3 91 12
%258 = OpConvertUToF %8 %257
%259 = OpCompositeConstruct %24 %258 %258 %258 %258
OpStore %208 %259
OpReturn
OpFunctionEnd
%262 = OpFunction %2 None %97
%260 = OpLabel
%263 = OpLoad %17 %46
%264 = OpLoad %19 %51
%265 = OpLoad %20 %53
%266 = OpLoad %21 %55
%267 = OpLoad %22 %57
%268 = OpLoad %23 %59
OpBranch %269
%269 = OpLabel
OpLine %3 96 25
%270 = OpImageQueryLevels %5 %263
OpLine %3 97 25
%271 = OpImageQuerySizeLod %13 %264 %219
%272 = OpCompositeExtract %5 %271 2
OpLine %3 98 31
%273 = OpImageQueryLevels %5 %264
OpLine %3 99 31
%274 = OpImageQuerySizeLod %13 %264 %219
%275 = OpCompositeExtract %5 %274 2
OpLine %3 100 27
%276 = OpImageQueryLevels %5 %265
OpLine %3 101 33
%277 = OpImageQueryLevels %5 %266
OpLine %3 102 27
%278 = OpImageQuerySizeLod %13 %266 %219
%279 = OpCompositeExtract %5 %278 2
OpLine %3 103 25
%280 = OpImageQueryLevels %5 %267
OpLine %3 104 26
%281 = OpImageQuerySamples %5 %268
OpLine %3 106 15
%282 = OpIAdd %5 %272 %279
%283 = OpIAdd %5 %282 %281
%284 = OpIAdd %5 %283 %270
%285 = OpIAdd %5 %284 %273
%286 = OpIAdd %5 %285 %280
%287 = OpIAdd %5 %286 %276
%288 = OpIAdd %5 %287 %277
OpLine %3 108 12
%289 = OpConvertUToF %8 %288
%290 = OpCompositeConstruct %24 %289 %289 %289 %289
OpStore %261 %290
OpReturn
OpFunctionEnd
%293 = OpFunction %2 None %97
%291 = OpLabel
%308 = OpVariable %309 Function %310
%294 = OpLoad %16 %44
%295 = OpLoad %17 %46
%296 = OpLoad %19 %51
%297 = OpLoad %21 %55
%298 = OpLoad %25 %61
OpBranch %311
%311 = OpLabel
OpLine %3 116 16
OpLine %3 117 17
OpLine %3 118 20
OpLine %3 121 5
%313 = OpSampledImage %312 %294 %298
%314 = OpImageSampleImplicitLod %24 %313 %299
%315 = OpLoad %24 %308
%316 = OpFAdd %24 %315 %314
OpLine %3 121 5
OpStore %308 %316
OpLine %3 122 5
%318 = OpSampledImage %317 %295 %298
%319 = OpImageSampleImplicitLod %24 %318 %301
%320 = OpLoad %24 %308
%321 = OpFAdd %24 %320 %319
OpLine %3 122 5
OpStore %308 %321
OpLine %3 123 5
%322 = OpSampledImage %317 %295 %298
%323 = OpImageSampleImplicitLod %24 %322 %301 ConstOffset %305
%324 = OpLoad %24 %308
%325 = OpFAdd %24 %324 %323
OpLine %3 123 5
OpStore %308 %325
OpLine %3 124 5
%326 = OpSampledImage %317 %295 %298
%327 = OpImageSampleExplicitLod %24 %326 %301 Lod %306
%328 = OpLoad %24 %308
%329 = OpFAdd %24 %328 %327
OpLine %3 124 5
OpStore %308 %329
OpLine %3 125 5
%330 = OpSampledImage %317 %295 %298
%331 = OpImageSampleExplicitLod %24 %330 %301 Lod|ConstOffset %306 %305
%332 = OpLoad %24 %308
%333 = OpFAdd %24 %332 %331
OpLine %3 125 5
OpStore %308 %333
OpLine %3 126 5
%334 = OpSampledImage %317 %295 %298
%335 = OpImageSampleImplicitLod %24 %334 %301 Bias|ConstOffset %307 %305
%336 = OpLoad %24 %308
%337 = OpFAdd %24 %336 %335
OpLine %3 126 5
OpStore %308 %337
OpLine %3 127 5
%339 = OpConvertUToF %8 %219
%340 = OpCompositeConstruct %302 %301 %339
%341 = OpSampledImage %338 %296 %298
%342 = OpImageSampleImplicitLod %24 %341 %340
%343 = OpLoad %24 %308
%344 = OpFAdd %24 %343 %342
OpLine %3 127 5
OpStore %308 %344
OpLine %3 128 5
%345 = OpConvertUToF %8 %219
%346 = OpCompositeConstruct %302 %301 %345
%347 = OpSampledImage %338 %296 %298
%348 = OpImageSampleImplicitLod %24 %347 %346 ConstOffset %305
%349 = OpLoad %24 %308
%350 = OpFAdd %24 %349 %348
OpLine %3 128 5
OpStore %308 %350
OpLine %3 129 5
%351 = OpConvertUToF %8 %219
%352 = OpCompositeConstruct %302 %301 %351
%353 = OpSampledImage %338 %296 %298
%354 = OpImageSampleExplicitLod %24 %353 %352 Lod %306
%355 = OpLoad %24 %308
%356 = OpFAdd %24 %355 %354
OpLine %3 129 5
OpStore %308 %356
OpLine %3 130 5
%357 = OpConvertUToF %8 %219
%358 = OpCompositeConstruct %302 %301 %357
%359 = OpSampledImage %338 %296 %298
%360 = OpImageSampleExplicitLod %24 %359 %358 Lod|ConstOffset %306 %305
%361 = OpLoad %24 %308
%362 = OpFAdd %24 %361 %360
OpLine %3 130 5
OpStore %308 %362
OpLine %3 131 5
%363 = OpConvertUToF %8 %219
%364 = OpCompositeConstruct %302 %301 %363
%365 = OpSampledImage %338 %296 %298
%366 = OpImageSampleImplicitLod %24 %365 %364 Bias|ConstOffset %307 %305
%367 = OpLoad %24 %308
%368 = OpFAdd %24 %367 %366
OpLine %3 131 5
OpStore %308 %368
OpLine %3 132 5
%369 = OpConvertSToF %8 %77
%370 = OpCompositeConstruct %302 %301 %369
%371 = OpSampledImage %338 %296 %298
%372 = OpImageSampleImplicitLod %24 %371 %370
%373 = OpLoad %24 %308
%374 = OpFAdd %24 %373 %372
OpLine %3 132 5
OpStore %308 %374
OpLine %3 133 5
%375 = OpConvertSToF %8 %77
%376 = OpCompositeConstruct %302 %301 %375
%377 = OpSampledImage %338 %296 %298
%378 = OpImageSampleImplicitLod %24 %377 %376 ConstOffset %305
%379 = OpLoad %24 %308
%380 = OpFAdd %24 %379 %378
OpLine %3 133 5
OpStore %308 %380
OpLine %3 134 5
%381 = OpConvertSToF %8 %77
%382 = OpCompositeConstruct %302 %301 %381
%383 = OpSampledImage %338 %296 %298
%384 = OpImageSampleExplicitLod %24 %383 %382 Lod %306
%385 = OpLoad %24 %308
%386 = OpFAdd %24 %385 %384
OpLine %3 134 5
OpStore %308 %386
OpLine %3 135 5
%387 = OpConvertSToF %8 %77
%388 = OpCompositeConstruct %302 %301 %387
%389 = OpSampledImage %338 %296 %298
%390 = OpImageSampleExplicitLod %24 %389 %388 Lod|ConstOffset %306 %305
%391 = OpLoad %24 %308
%392 = OpFAdd %24 %391 %390
OpLine %3 135 5
OpStore %308 %392
OpLine %3 136 5
%393 = OpConvertSToF %8 %77
%394 = OpCompositeConstruct %302 %301 %393
%395 = OpSampledImage %338 %296 %298
%396 = OpImageSampleImplicitLod %24 %395 %394 Bias|ConstOffset %307 %305
%397 = OpLoad %24 %308
%398 = OpFAdd %24 %397 %396
OpLine %3 136 5
OpStore %308 %398
OpLine %3 137 5
%400 = OpConvertUToF %8 %219
%401 = OpCompositeConstruct %24 %303 %400
%402 = OpSampledImage %399 %297 %298
%403 = OpImageSampleImplicitLod %24 %402 %401
%404 = OpLoad %24 %308
%405 = OpFAdd %24 %404 %403
OpLine %3 137 5
OpStore %308 %405
OpLine %3 138 5
%406 = OpConvertUToF %8 %219
%407 = OpCompositeConstruct %24 %303 %406
%408 = OpSampledImage %399 %297 %298
%409 = OpImageSampleExplicitLod %24 %408 %407 Lod %306
%410 = OpLoad %24 %308
%411 = OpFAdd %24 %410 %409
OpLine %3 138 5
OpStore %308 %411
OpLine %3 139 5
%412 = OpConvertUToF %8 %219
%413 = OpCompositeConstruct %24 %303 %412
%414 = OpSampledImage %399 %297 %298
%415 = OpImageSampleImplicitLod %24 %414 %413 Bias %307
%416 = OpLoad %24 %308
%417 = OpFAdd %24 %416 %415
OpLine %3 139 5
OpStore %308 %417
OpLine %3 140 5
%418 = OpConvertSToF %8 %77
%419 = OpCompositeConstruct %24 %303 %418
%420 = OpSampledImage %399 %297 %298
%421 = OpImageSampleImplicitLod %24 %420 %419
%422 = OpLoad %24 %308
%423 = OpFAdd %24 %422 %421
OpLine %3 140 5
OpStore %308 %423
OpLine %3 141 5
%424 = OpConvertSToF %8 %77
%425 = OpCompositeConstruct %24 %303 %424
%426 = OpSampledImage %399 %297 %298
%427 = OpImageSampleExplicitLod %24 %426 %425 Lod %306
%428 = OpLoad %24 %308
%429 = OpFAdd %24 %428 %427
OpLine %3 141 5
OpStore %308 %429
OpLine %3 142 5
%430 = OpConvertSToF %8 %77
%431 = OpCompositeConstruct %24 %303 %430
%432 = OpSampledImage %399 %297 %298
%433 = OpImageSampleImplicitLod %24 %432 %431 Bias %307
%434 = OpLoad %24 %308
%435 = OpFAdd %24 %434 %433
OpLine %3 142 5
OpStore %308 %435
OpLine %3 1 1
%436 = OpLoad %24 %308
OpStore %292 %436
OpReturn
OpFunctionEnd
%440 = OpFunction %2 None %97
%437 = OpLabel
%445 = OpVariable %446 Function %447
%441 = OpLoad %25 %63
%442 = OpLoad %26 %64
%443 = OpLoad %27 %66
%444 = OpLoad %28 %68
OpBranch %448
%448 = OpLabel
OpLine %3 157 14
OpLine %3 158 15
OpLine %3 161 5
%450 = OpSampledImage %449 %442 %441
%451 = OpImageSampleDrefImplicitLod %8 %450 %301 %299
%452 = OpLoad %8 %445
%453 = OpFAdd %8 %452 %451
OpLine %3 161 5
OpStore %445 %453
OpLine %3 162 5
%455 = OpConvertUToF %8 %219
%456 = OpCompositeConstruct %302 %301 %455
%457 = OpSampledImage %454 %443 %441
%458 = OpImageSampleDrefImplicitLod %8 %457 %456 %299
%459 = OpLoad %8 %445
%460 = OpFAdd %8 %459 %458
OpLine %3 162 5
OpStore %445 %460
OpLine %3 163 5
%461 = OpConvertSToF %8 %77
%462 = OpCompositeConstruct %302 %301 %461
%463 = OpSampledImage %454 %443 %441
%464 = OpImageSampleDrefImplicitLod %8 %463 %462 %299
%465 = OpLoad %8 %445
%466 = OpFAdd %8 %465 %464
OpLine %3 163 5
OpStore %445 %466
OpLine %3 164 5
%468 = OpSampledImage %467 %444 %441
%469 = OpImageSampleDrefImplicitLod %8 %468 %303 %299
%470 = OpLoad %8 %445
%471 = OpFAdd %8 %470 %469
OpLine %3 164 5
OpStore %445 %471
OpLine %3 165 5
%472 = OpSampledImage %449 %442 %441
%473 = OpImageSampleDrefExplicitLod %8 %472 %301 %299 Lod %474
%475 = OpLoad %8 %445
%476 = OpFAdd %8 %475 %473
OpLine %3 165 5
OpStore %445 %476
OpLine %3 166 5
%477 = OpConvertUToF %8 %219
%478 = OpCompositeConstruct %302 %301 %477
%479 = OpSampledImage %454 %443 %441
%480 = OpImageSampleDrefExplicitLod %8 %479 %478 %299 Lod %474
%481 = OpLoad %8 %445
%482 = OpFAdd %8 %481 %480
OpLine %3 166 5
OpStore %445 %482
OpLine %3 167 5
%483 = OpConvertSToF %8 %77
%484 = OpCompositeConstruct %302 %301 %483
%485 = OpSampledImage %454 %443 %441
%486 = OpImageSampleDrefExplicitLod %8 %485 %484 %299 Lod %474
%487 = OpLoad %8 %445
%488 = OpFAdd %8 %487 %486
OpLine %3 167 5
OpStore %445 %488
OpLine %3 168 5
%489 = OpSampledImage %467 %444 %441
%490 = OpImageSampleDrefExplicitLod %8 %489 %303 %299 Lod %474
%491 = OpLoad %8 %445
%492 = OpFAdd %8 %491 %490
OpLine %3 168 5
OpStore %445 %492
OpLine %3 1 1
%493 = OpLoad %8 %445
OpStore %438 %493
OpReturn
OpFunctionEnd
%496 = OpFunction %2 None %97
%494 = OpLabel
%497 = OpLoad %17 %46
%498 = OpLoad %4 %48
%499 = OpLoad %18 %49
%500 = OpLoad %25 %61
%501 = OpLoad %25 %63
%502 = OpLoad %26 %64
OpBranch %503
%503 = OpLabel
OpLine %3 174 14
OpLine %3 176 15
%504 = OpSampledImage %317 %497 %500
%505 = OpImageGather %24 %504 %301 %506
OpLine %3 177 22
%507 = OpSampledImage %317 %497 %500
%508 = OpImageGather %24 %507 %301 %509 ConstOffset %305
OpLine %3 178 21
%510 = OpSampledImage %449 %502 %501
%511 = OpImageDrefGather %24 %510 %301 %299
OpLine %3 179 28
%512 = OpSampledImage %449 %502 %501
%513 = OpImageDrefGather %24 %512 %301 %299 ConstOffset %305
OpLine %3 181 13
%515 = OpSampledImage %514 %498 %500
%516 = OpImageGather %116 %515 %301 %219
OpLine %3 182 13
%519 = OpSampledImage %518 %499 %500
%520 = OpImageGather %517 %519 %301 %219
OpLine %3 183 13
%521 = OpConvertUToF %24 %516
%522 = OpConvertSToF %24 %520
%523 = OpFAdd %24 %521 %522
OpLine %3 185 12
%524 = OpFAdd %24 %505 %508
%525 = OpFAdd %24 %524 %511
%526 = OpFAdd %24 %525 %513
%527 = OpFAdd %24 %526 %523
OpStore %495 %527
OpReturn
OpFunctionEnd
%530 = OpFunction %2 None %97
%528 = OpLabel
%531 = OpLoad %25 %61
%532 = OpLoad %26 %64
OpBranch %533
%533 = OpLabel
OpLine %3 190 14
OpLine %3 192 15
%534 = OpSampledImage %449 %532 %531
%535 = OpImageSampleImplicitLod %24 %534 %301
%536 = OpCompositeExtract %8 %535 0
OpLine %3 193 22
%537 = OpSampledImage %449 %532 %531
%538 = OpImageGather %24 %537 %301 %219
OpLine %3 194 21
%539 = OpSampledImage %449 %532 %531
%541 = OpConvertSToF %8 %88
%540 = OpImageSampleExplicitLod %24 %539 %301 Lod %541
%542 = OpCompositeExtract %8 %540 0
OpLine %3 192 15
%543 = OpCompositeConstruct %24 %536 %536 %536 %536
%544 = OpFAdd %24 %543 %538
%545 = OpCompositeConstruct %24 %542 %542 %542 %542
%546 = OpFAdd %24 %544 %545
OpStore %529 %546
OpReturn
OpFunctionEnd