• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; SPIR-V
2; Version: 1.0
3; Generator: Khronos Glslang Reference Front End; 1
4; Bound: 75
5; Schema: 0
6               OpCapability Shader
7          %1 = OpExtInstImport "GLSL.std.450"
8               OpMemoryModel Logical GLSL450
9               OpEntryPoint GLCompute %main "main" %gl_GlobalInvocationID
10               OpExecutionMode %main LocalSize 4 1 1
11               OpSource GLSL 450
12               OpSourceExtension "GL_ARB_shading_language_420pack"
13               OpSourceExtension "GL_GOOGLE_cpp_style_line_directive"
14               OpSourceExtension "GL_GOOGLE_include_directive"
15               OpName %main "main"
16               OpName %greyscale_vf4_ "greyscale(vf4;"
17               OpName %p "p"
18               OpName %globalBuffer "globalBuffer"
19               OpMemberName %globalBuffer 0 "coeff"
20               OpMemberName %globalBuffer 1 "width"
21               OpMemberName %globalBuffer 2 "height"
22               OpName %globalBlock "globalBlock"
23               OpName %xy "xy"
24               OpName %gl_GlobalInvocationID "gl_GlobalInvocationID"
25               OpName %inputPixel "inputPixel"
26               OpName %inputTexture "inputTexture"
27               OpName %res "res"
28               OpName %x "x"
29               OpName %y "y"
30               OpName %outputBufferS "outputBufferS"
31               OpMemberName %outputBufferS 0 "buf"
32               OpName %outputBuffer "outputBuffer"
33               OpMemberDecorate %globalBuffer 0 Offset 0
34               OpMemberDecorate %globalBuffer 1 Offset 16
35               OpMemberDecorate %globalBuffer 2 Offset 20
36               OpDecorate %globalBuffer BufferBlock
37               OpDecorate %globalBlock DescriptorSet 0
38               OpDecorate %globalBlock Binding 2
39               OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
40               OpDecorate %inputTexture DescriptorSet 0
41               OpDecorate %inputTexture Binding 0
42               OpDecorate %_runtimearr_v4float ArrayStride 16
43               OpMemberDecorate %outputBufferS 0 Offset 0
44               OpDecorate %outputBufferS BufferBlock
45               OpDecorate %outputBuffer DescriptorSet 0
46               OpDecorate %outputBuffer Binding 1
47               OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize
48       %void = OpTypeVoid
49          %3 = OpTypeFunction %void
50      %float = OpTypeFloat 32
51    %v4float = OpTypeVector %float 4
52          %8 = OpTypeFunction %v4float %v4float
53        %int = OpTypeInt 32 1
54%globalBuffer = OpTypeStruct %v4float %int %int
55%_ptr_Uniform_globalBuffer = OpTypePointer Uniform %globalBuffer
56%globalBlock = OpVariable %_ptr_Uniform_globalBuffer Uniform
57         %16 = OpConstant %int 0
58%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
59      %v2int = OpTypeVector %int 2
60%_ptr_Function_v2int = OpTypePointer Function %v2int
61       %uint = OpTypeInt 32 0
62     %v3uint = OpTypeVector %uint 3
63%_ptr_Input_v3uint = OpTypePointer Input %v3uint
64%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
65     %v2uint = OpTypeVector %uint 2
66%_ptr_Function_v4float = OpTypePointer Function %v4float
67         %37 = OpTypeImage %float 2D 0 0 0 1 Unknown
68         %38 = OpTypeSampledImage %37
69%_ptr_UniformConstant_38 = OpTypePointer UniformConstant %38
70%inputTexture = OpVariable %_ptr_UniformConstant_38 UniformConstant
71%_ptr_Function_uint = OpTypePointer Function %uint
72         %50 = OpConstant %uint 0
73%_ptr_Input_uint = OpTypePointer Input %uint
74         %55 = OpConstant %uint 1
75%_runtimearr_v4float = OpTypeRuntimeArray %v4float
76%outputBufferS = OpTypeStruct %_runtimearr_v4float
77%_ptr_Uniform_outputBufferS = OpTypePointer Uniform %outputBufferS
78%outputBuffer = OpVariable %_ptr_Uniform_outputBufferS Uniform
79         %63 = OpConstant %int 1
80%_ptr_Uniform_int = OpTypePointer Uniform %int
81         %73 = OpConstant %uint 4
82%gl_WorkGroupSize = OpConstantComposite %v3uint %73 %55 %55
83       %main = OpFunction %void None %3
84          %5 = OpLabel
85         %xy = OpVariable %_ptr_Function_v2int Function
86 %inputPixel = OpVariable %_ptr_Function_v4float Function
87        %res = OpVariable %_ptr_Function_v4float Function
88          %x = OpVariable %_ptr_Function_uint Function
89          %y = OpVariable %_ptr_Function_uint Function
90         %32 = OpLoad %v3uint %gl_GlobalInvocationID
91         %33 = OpVectorShuffle %v2uint %32 %32 0 1
92         %34 = OpBitcast %v2int %33
93               OpStore %xy %34
94         %41 = OpLoad %38 %inputTexture
95         %42 = OpLoad %v2int %xy
96         %43 = OpImage %37 %41
97         %44 = OpImageFetch %v4float %43 %42 Lod %16
98               OpStore %inputPixel %44
99         %46 = OpLoad %v4float %inputPixel
100         %47 = OpFunctionCall %v4float %greyscale_vf4_ %46
101               OpStore %res %47
102         %52 = OpAccessChain %_ptr_Input_uint %gl_GlobalInvocationID %50
103         %53 = OpLoad %uint %52
104               OpStore %x %53
105         %56 = OpAccessChain %_ptr_Input_uint %gl_GlobalInvocationID %55
106         %57 = OpLoad %uint %56
107               OpStore %y %57
108         %62 = OpLoad %uint %y
109         %65 = OpAccessChain %_ptr_Uniform_int %globalBlock %63
110         %66 = OpLoad %int %65
111         %67 = OpBitcast %uint %66
112         %68 = OpIMul %uint %62 %67
113         %69 = OpLoad %uint %x
114         %70 = OpIAdd %uint %68 %69
115         %71 = OpLoad %v4float %res
116         %72 = OpAccessChain %_ptr_Uniform_v4float %outputBuffer %16 %70
117               OpStore %72 %71
118               OpReturn
119               OpFunctionEnd
120%greyscale_vf4_ = OpFunction %v4float None %8
121          %p = OpFunctionParameter %v4float
122         %11 = OpLabel
123         %18 = OpAccessChain %_ptr_Uniform_v4float %globalBlock %16
124         %19 = OpLoad %v4float %18
125         %20 = OpDot %float %p %19
126         %21 = OpCompositeConstruct %v4float %20 %20 %20 %20
127               OpReturnValue %21
128               OpFunctionEnd
129