Skip to content

Instantly share code, notes, and snippets.

@MaikKlein
Created September 22, 2018 14:19
Show Gist options
  • Save MaikKlein/867816e954a09985e2a50eb838504b9b to your computer and use it in GitHub Desktop.
Save MaikKlein/867816e954a09985e2a50eb838504b9b to your computer and use it in GitHub Desktop.
; SPIR-V
; Version: 1.0
; Generator: Google rspirv; 0
; Bound: 266
; Schema: 0
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %3 "fragment" %11 %15 %21
OpExecutionMode %3 OriginUpperLeft
OpMemberName %_ZN9rlsl_math5entry5Input 0 "data"
OpName %_ZN9rlsl_math5entry5Input "_ZN9rlsl_math5entry5Input"
OpMemberName %_ZN9rlsl_math5entry6Output 0 "data"
OpName %_ZN9rlsl_math5entry6Output "_ZN9rlsl_math5entry6Output"
OpMemberName %_ZN9rlsl_math5entry7Uniform 0 "data"
OpName %_ZN9rlsl_math5entry7Uniform "_ZN9rlsl_math5entry7Uniform"
OpMemberName %_ZN9rlsl_math5entry8Fragment 0 "frag_coord"
OpName %_ZN9rlsl_math5entry8Fragment "_ZN9rlsl_math5entry8Fragment"
OpName %_ZN4core6marker11PhantomData "_ZN4core6marker11PhantomData"
OpName %bb0 "bb0"
OpName %bb2 "bb2"
OpName %bb1 "bb1"
OpName %bb3 "bb3"
OpName %_ZN45__LT_f32_u20_as_u20_core__ops__arith__Add_GT_3add "_ZN45_$LT$f32$u20$as$u20$core..ops..arith..Add$GT$3add"
OpName %bb0_0 "bb0"
OpName %_ZN74__LT_rlsl_math__vector__Vec3_LT_T_GT__u20_as_u20_core__ops__arith__Add_GT_3add "_ZN74_$LT$rlsl_math..vector..Vec3$LT$T$GT$$u20$as$u20$core..ops..arith..Add$GT$3add"
OpName %bb0_1 "bb0"
OpName %bb1_0 "bb1"
OpName %bb2_0 "bb2"
OpName %bb3_0 "bb3"
OpName %_ZN9shadertoy8fragment28__u7b__u7b_closure_u7d__u7d_ "_ZN9shadertoy8fragment28_$u7b$$u7b$closure$u7d$$u7d$"
OpName %bb0_2 "bb0"
OpName %bb1_1 "bb1"
OpName %_ZN41__LT_rlsl_math__vector__Vec3_LT_T_GT__GT_3map "_ZN41_$LT$rlsl_math..vector..Vec3$LT$T$GT$$GT$3map"
OpName %bb0_3 "bb0"
OpName %bb2_1 "bb2"
OpName %bb4 "bb4"
OpName %bb6 "bb6"
OpName %bb8 "bb8"
OpMemberDecorate %_ZN9rlsl_math5entry5Input 0 Offset 0
OpDecorate %_ZN9rlsl_math5entry5Input Block
OpMemberDecorate %_ZN9rlsl_math5entry5Input 0 Location 0
OpMemberDecorate %_ZN9rlsl_math5entry6Output 0 Offset 0
OpDecorate %_ZN9rlsl_math5entry6Output Block
OpMemberDecorate %_ZN9rlsl_math5entry6Output 0 Location 0
OpMemberDecorate %_ZN9rlsl_math5entry7Uniform 0 Offset 0
OpDecorate %_ZN9rlsl_math5entry7Uniform Block
OpMemberDecorate %_ZN9rlsl_math5entry8Fragment 0 Offset 0
OpDecorate %_ZN9rlsl_math5entry8Fragment Block
OpMemberDecorate %_ZN9rlsl_math5entry8Fragment 0 BuiltIn FragCoord
OpDecorate %18 DescriptorSet 0
OpDecorate %18 Binding 0
%float = OpTypeFloat 32
%v2float = OpTypeVector %float 2
%_ZN9rlsl_math5entry5Input = OpTypeStruct %v2float
%_ptr_Input__ZN9rlsl_math5entry5Input = OpTypePointer Input %_ZN9rlsl_math5entry5Input
%11 = OpVariable %_ptr_Input__ZN9rlsl_math5entry5Input Input
%v4float = OpTypeVector %float 4
%_ZN9rlsl_math5entry6Output = OpTypeStruct %v4float
%_ptr_Output__ZN9rlsl_math5entry6Output = OpTypePointer Output %_ZN9rlsl_math5entry6Output
%15 = OpVariable %_ptr_Output__ZN9rlsl_math5entry6Output Output
%_ZN9rlsl_math5entry7Uniform = OpTypeStruct %float
%_ptr_Uniform__ZN9rlsl_math5entry7Uniform = OpTypePointer Uniform %_ZN9rlsl_math5entry7Uniform
%18 = OpVariable %_ptr_Uniform__ZN9rlsl_math5entry7Uniform Uniform
%_ZN9rlsl_math5entry8Fragment = OpTypeStruct %v4float
%_ptr_Input__ZN9rlsl_math5entry8Fragment = OpTypePointer Input %_ZN9rlsl_math5entry8Fragment
%21 = OpVariable %_ptr_Input__ZN9rlsl_math5entry8Fragment Input
%void = OpTypeVoid
%23 = OpTypeFunction %void
%_ptr_Function_v2float = OpTypePointer Function %v2float
%_ptr_Function_float = OpTypePointer Function %float
%v3float = OpTypeVector %float 3
%_ptr_Function_v3float = OpTypePointer Function %v3float
%_ptr_Function_v4float = OpTypePointer Function %v4float
%_struct_47 = OpTypeStruct %float
%_ptr_Function__struct_47 = OpTypePointer Function %_struct_47
%_ZN4core6marker11PhantomData = OpTypeStruct
%_ptr_Function__ZN4core6marker11PhantomData = OpTypePointer Function %_ZN4core6marker11PhantomData
%_ptr_Function__ZN9rlsl_math5entry5Input = OpTypePointer Function %_ZN9rlsl_math5entry5Input
%_ptr_Input_v2float = OpTypePointer Input %v2float
%uint = OpTypeInt 32 0
%uint_0 = OpConstant %uint 0
%_ptr_Function__ZN9rlsl_math5entry7Uniform = OpTypePointer Function %_ZN9rlsl_math5entry7Uniform
%_ptr_Uniform_float = OpTypePointer Uniform %float
%float_0 = OpConstant %float 0
%float_2 = OpConstant %float 2
%uint_1 = OpConstant %uint 1
%float_4 = OpConstant %float 4
%uint_2 = OpConstant %uint 2
%float_0_5 = OpConstant %float 0.5
%float_1 = OpConstant %float 1
%uint_3 = OpConstant %uint 3
%_ptr_Output_v4float = OpTypePointer Output %v4float
%126 = OpTypeFunction %float %float %float
%142 = OpTypeFunction %v3float %v3float %v3float
%190 = OpTypeFunction %float %_ptr_Function__struct_47 %float
%211 = OpTypeFunction %v3float %v3float %_struct_47
%_struct_228 = OpTypeStruct %float
%_ptr_Function__struct_228 = OpTypePointer Function %_struct_228
%3 = OpFunction %void None %23
%24 = OpLabel
%30 = OpVariable %_ptr_Function_v2float Function
%31 = OpVariable %_ptr_Function_v2float Function
%33 = OpVariable %_ptr_Function_float Function
%34 = OpVariable %_ptr_Function_float Function
%37 = OpVariable %_ptr_Function_v3float Function
%39 = OpVariable %_ptr_Function_v4float Function
%40 = OpVariable %_ptr_Function_v3float Function
%41 = OpVariable %_ptr_Function_v3float Function
%42 = OpVariable %_ptr_Function_v3float Function
%43 = OpVariable %_ptr_Function_v3float Function
%44 = OpVariable %_ptr_Function_v2float Function
%45 = OpVariable %_ptr_Function_float Function
%46 = OpVariable %_ptr_Function_v3float Function
%49 = OpVariable %_ptr_Function__struct_47 Function
%50 = OpVariable %_ptr_Function_v3float Function
%51 = OpVariable %_ptr_Function_v4float Function
%52 = OpVariable %_ptr_Function_float Function
%53 = OpVariable %_ptr_Function_float Function
%54 = OpVariable %_ptr_Function_float Function
%55 = OpVariable %_ptr_Function_float Function
%56 = OpVariable %_ptr_Function_float Function
%59 = OpVariable %_ptr_Function__ZN4core6marker11PhantomData Function
OpBranch %bb0
%bb0 = OpLabel
%64 = OpAccessChain %_ptr_Input_v2float %11 %uint_0
%65 = OpLoad %v2float %64
OpStore %31 %65
%68 = OpAccessChain %_ptr_Uniform_float %18 %uint_0
%69 = OpLoad %float %68
OpStore %34 %69
%71 = OpAccessChain %_ptr_Function_float %37 %uint_0
OpStore %71 %float_0
%74 = OpAccessChain %_ptr_Function_float %37 %uint_1
OpStore %74 %float_2
%77 = OpAccessChain %_ptr_Function_float %37 %uint_2
OpStore %77 %float_4
%78 = OpLoad %v2float %31
OpStore %44 %78
%79 = OpAccessChain %_ptr_Function_float %31 %uint_1
%80 = OpLoad %float %79
OpStore %45 %80
%81 = OpAccessChain %_ptr_Function_float %44 %uint_0
%82 = OpLoad %float %81
OpStore %52 %82
%83 = OpAccessChain %_ptr_Function_float %44 %uint_1
%84 = OpLoad %float %83
OpStore %53 %84
%85 = OpLoad %float %52
%86 = OpAccessChain %_ptr_Function_float %43 %uint_0
OpStore %86 %85
%87 = OpLoad %float %53
%88 = OpAccessChain %_ptr_Function_float %43 %uint_1
OpStore %88 %87
%89 = OpLoad %float %45
%90 = OpAccessChain %_ptr_Function_float %43 %uint_2
OpStore %90 %89
%91 = OpLoad %v3float %37
OpStore %46 %91
%92 = OpLoad %v3float %43
%93 = OpLoad %v3float %46
%94 = OpFunctionCall %v3float %_ZN74__LT_rlsl_math__vector__Vec3_LT_T_GT__u20_as_u20_core__ops__arith__Add_GT_3add %92 %93
OpStore %42 %94
OpBranch %bb2
%bb2 = OpLabel
%95 = OpLoad %float %34
%96 = OpAccessChain %_ptr_Function_float %49 %uint_0
OpStore %96 %95
%97 = OpLoad %v3float %42
%98 = OpLoad %_struct_47 %49
%99 = OpFunctionCall %v3float %_ZN41__LT_rlsl_math__vector__Vec3_LT_T_GT__GT_3map %97 %98
OpStore %41 %99
OpBranch %bb1
%bb1 = OpLabel
%101 = OpAccessChain %_ptr_Function_float %50 %uint_0
OpStore %101 %float_0_5
%102 = OpAccessChain %_ptr_Function_float %50 %uint_1
OpStore %102 %float_0_5
%103 = OpAccessChain %_ptr_Function_float %50 %uint_2
OpStore %103 %float_0_5
%104 = OpLoad %v3float %41
%105 = OpLoad %v3float %50
%106 = OpFunctionCall %v3float %_ZN74__LT_rlsl_math__vector__Vec3_LT_T_GT__u20_as_u20_core__ops__arith__Add_GT_3add %104 %105
OpStore %40 %106
OpBranch %bb3
%bb3 = OpLabel
%107 = OpAccessChain %_ptr_Function_float %40 %uint_0
%108 = OpLoad %float %107
OpStore %54 %108
%109 = OpAccessChain %_ptr_Function_float %40 %uint_1
%110 = OpLoad %float %109
OpStore %55 %110
%111 = OpAccessChain %_ptr_Function_float %40 %uint_2
%112 = OpLoad %float %111
OpStore %56 %112
%113 = OpLoad %float %54
%114 = OpAccessChain %_ptr_Function_float %39 %uint_0
OpStore %114 %113
%115 = OpLoad %float %55
%116 = OpAccessChain %_ptr_Function_float %39 %uint_1
OpStore %116 %115
%117 = OpLoad %float %56
%118 = OpAccessChain %_ptr_Function_float %39 %uint_2
OpStore %118 %117
%121 = OpAccessChain %_ptr_Function_float %39 %uint_3
OpStore %121 %float_1
%122 = OpLoad %v4float %39
OpStore %51 %122
%123 = OpLoad %v4float %51
%125 = OpAccessChain %_ptr_Output_v4float %15 %uint_0
OpStore %125 %123
OpReturn
OpFunctionEnd
%_ZN45__LT_f32_u20_as_u20_core__ops__arith__Add_GT_3add = OpFunction %float None %126
%127 = OpFunctionParameter %float
%128 = OpFunctionParameter %float
%129 = OpLabel
%130 = OpVariable %_ptr_Function_float Function
OpStore %130 %127
%131 = OpVariable %_ptr_Function_float Function
OpStore %131 %128
%132 = OpVariable %_ptr_Function_float Function
%134 = OpVariable %_ptr_Function_float Function
%135 = OpVariable %_ptr_Function_float Function
OpBranch %bb0_0
%bb0_0 = OpLabel
%136 = OpLoad %float %130
OpStore %134 %136
%137 = OpLoad %float %131
OpStore %135 %137
%138 = OpLoad %float %134
%139 = OpLoad %float %135
%140 = OpFAdd %float %138 %139
OpStore %132 %140
%141 = OpLoad %float %132
OpReturnValue %141
OpFunctionEnd
%_ZN74__LT_rlsl_math__vector__Vec3_LT_T_GT__u20_as_u20_core__ops__arith__Add_GT_3add = OpFunction %v3float None %142
%143 = OpFunctionParameter %v3float
%144 = OpFunctionParameter %v3float
%145 = OpLabel
%146 = OpVariable %_ptr_Function_v3float Function
OpStore %146 %143
%147 = OpVariable %_ptr_Function_v3float Function
OpStore %147 %144
%148 = OpVariable %_ptr_Function_v3float Function
%153 = OpVariable %_ptr_Function_float Function
%154 = OpVariable %_ptr_Function_float Function
%155 = OpVariable %_ptr_Function_float Function
%156 = OpVariable %_ptr_Function_float Function
%157 = OpVariable %_ptr_Function_float Function
%158 = OpVariable %_ptr_Function_float Function
%159 = OpVariable %_ptr_Function_float Function
%160 = OpVariable %_ptr_Function_float Function
%161 = OpVariable %_ptr_Function_float Function
OpBranch %bb0_1
%bb0_1 = OpLabel
%162 = OpAccessChain %_ptr_Function_float %146 %uint_0
%163 = OpLoad %float %162
OpStore %154 %163
%164 = OpAccessChain %_ptr_Function_float %147 %uint_0
%165 = OpLoad %float %164
OpStore %155 %165
%166 = OpLoad %float %154
%167 = OpLoad %float %155
%168 = OpFunctionCall %float %_ZN45__LT_f32_u20_as_u20_core__ops__arith__Add_GT_3add %166 %167
OpStore %153 %168
OpBranch %bb1_0
%bb1_0 = OpLabel
%169 = OpAccessChain %_ptr_Function_float %146 %uint_1
%170 = OpLoad %float %169
OpStore %157 %170
%171 = OpAccessChain %_ptr_Function_float %147 %uint_1
%172 = OpLoad %float %171
OpStore %158 %172
%173 = OpLoad %float %157
%174 = OpLoad %float %158
%175 = OpFunctionCall %float %_ZN45__LT_f32_u20_as_u20_core__ops__arith__Add_GT_3add %173 %174
OpStore %156 %175
OpBranch %bb2_0
%bb2_0 = OpLabel
%176 = OpAccessChain %_ptr_Function_float %146 %uint_2
%177 = OpLoad %float %176
OpStore %160 %177
%178 = OpAccessChain %_ptr_Function_float %147 %uint_2
%179 = OpLoad %float %178
OpStore %161 %179
%180 = OpLoad %float %160
%181 = OpLoad %float %161
%182 = OpFunctionCall %float %_ZN45__LT_f32_u20_as_u20_core__ops__arith__Add_GT_3add %180 %181
OpStore %159 %182
OpBranch %bb3_0
%bb3_0 = OpLabel
%183 = OpLoad %float %153
%184 = OpAccessChain %_ptr_Function_float %148 %uint_0
OpStore %184 %183
%185 = OpLoad %float %156
%186 = OpAccessChain %_ptr_Function_float %148 %uint_1
OpStore %186 %185
%187 = OpLoad %float %159
%188 = OpAccessChain %_ptr_Function_float %148 %uint_2
OpStore %188 %187
%189 = OpLoad %v3float %148
OpReturnValue %189
OpFunctionEnd
%_ZN9shadertoy8fragment28__u7b__u7b_closure_u7d__u7d_ = OpFunction %float None %190
%191 = OpFunctionParameter %_ptr_Function__struct_47
%192 = OpFunctionParameter %float
%193 = OpLabel
%194 = OpVariable %_ptr_Function_float Function
OpStore %194 %192
%195 = OpVariable %_ptr_Function_float Function
%198 = OpVariable %_ptr_Function_float Function
%199 = OpVariable %_ptr_Function_float Function
%200 = OpVariable %_ptr_Function_float Function
OpBranch %bb0_2
%bb0_2 = OpLabel
%201 = OpAccessChain %_ptr_Function_float %191 %uint_0
%202 = OpLoad %float %201
OpStore %200 %202
%203 = OpLoad %float %200
%204 = OpLoad %float %194
%205 = OpFAdd %float %203 %204
OpStore %199 %205
%206 = OpLoad %float %199
%207 = OpExtInst %float %1 Cos %206
OpStore %198 %207
OpBranch %bb1_1
%bb1_1 = OpLabel
%208 = OpLoad %float %198
%209 = OpFMul %float %208 %float_0_5
OpStore %195 %209
%210 = OpLoad %float %195
OpReturnValue %210
OpFunctionEnd
%_ZN41__LT_rlsl_math__vector__Vec3_LT_T_GT__GT_3map = OpFunction %v3float None %211
%212 = OpFunctionParameter %v3float
%213 = OpFunctionParameter %_struct_47
%214 = OpLabel
%215 = OpVariable %_ptr_Function_v3float Function
OpStore %215 %212
%216 = OpVariable %_ptr_Function__struct_47 Function
OpStore %216 %213
%217 = OpVariable %_ptr_Function_v3float Function
%227 = OpVariable %_ptr_Function_float Function
%230 = OpVariable %_ptr_Function__struct_228 Function
%231 = OpVariable %_ptr_Function_float Function
%232 = OpVariable %_ptr_Function_float Function
%233 = OpVariable %_ptr_Function__struct_228 Function
%234 = OpVariable %_ptr_Function_float Function
%235 = OpVariable %_ptr_Function_float Function
%236 = OpVariable %_ptr_Function__struct_228 Function
%237 = OpVariable %_ptr_Function_float Function
OpBranch %bb0_3
%bb0_3 = OpLabel
%238 = OpAccessChain %_ptr_Function_float %215 %uint_0
%239 = OpLoad %float %238
OpStore %231 %239
%240 = OpLoad %float %231
%241 = OpAccessChain %_ptr_Function_float %230 %uint_0
OpStore %241 %240
%242 = OpAccessChain %_ptr_Function_float %230 %uint_0
%243 = OpLoad %float %242
%244 = OpFunctionCall %float %_ZN9shadertoy8fragment28__u7b__u7b_closure_u7d__u7d_ %216 %243
OpStore %227 %244
OpBranch %bb2_1
%bb2_1 = OpLabel
%245 = OpAccessChain %_ptr_Function_float %215 %uint_1
%246 = OpLoad %float %245
OpStore %234 %246
%247 = OpLoad %float %234
%248 = OpAccessChain %_ptr_Function_float %233 %uint_0
OpStore %248 %247
%249 = OpAccessChain %_ptr_Function_float %233 %uint_0
%250 = OpLoad %float %249
%251 = OpFunctionCall %float %_ZN9shadertoy8fragment28__u7b__u7b_closure_u7d__u7d_ %216 %250
OpStore %232 %251
OpBranch %bb4
%bb4 = OpLabel
%252 = OpAccessChain %_ptr_Function_float %215 %uint_2
%253 = OpLoad %float %252
OpStore %237 %253
%254 = OpLoad %float %237
%255 = OpAccessChain %_ptr_Function_float %236 %uint_0
OpStore %255 %254
%256 = OpAccessChain %_ptr_Function_float %236 %uint_0
%257 = OpLoad %float %256
%258 = OpFunctionCall %float %_ZN9shadertoy8fragment28__u7b__u7b_closure_u7d__u7d_ %216 %257
OpStore %235 %258
OpBranch %bb6
%bb6 = OpLabel
%259 = OpLoad %float %227
%260 = OpAccessChain %_ptr_Function_float %217 %uint_0
OpStore %260 %259
%261 = OpLoad %float %232
%262 = OpAccessChain %_ptr_Function_float %217 %uint_1
OpStore %262 %261
%263 = OpLoad %float %235
%264 = OpAccessChain %_ptr_Function_float %217 %uint_2
OpStore %264 %263
OpBranch %bb8
%bb8 = OpLabel
%265 = OpLoad %v3float %217
OpReturnValue %265
OpFunctionEnd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment