Skip to content

Instantly share code, notes, and snippets.

@MaikKlein
Created October 3, 2018 08:16
Show Gist options
  • Save MaikKlein/7a0fb8553eef617dfd431989d1a5f0d4 to your computer and use it in GitHub Desktop.
Save MaikKlein/7a0fb8553eef617dfd431989d1a5f0d4 to your computer and use it in GitHub Desktop.
; SPIR-V
; Version: 1.0
; Generator: Google rspirv; 0
; Bound: 127
; Schema: 0
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %3 "compute" %15
OpExecutionMode %3 LocalSize 1 1 1
OpMemberName %_ZN9rlsl_math5entry6Buffer 0 "data"
OpName %_ZN9rlsl_math5entry6Buffer "_ZN9rlsl_math5entry6Buffer"
OpMemberName %_ZN9rlsl_math5entry7Compute 0 "local_invocation_index"
OpMemberName %_ZN9rlsl_math5entry7Compute 1 "global_invocation_index"
OpName %_ZN9rlsl_math5entry7Compute "_ZN9rlsl_math5entry7Compute"
OpName %bb0 "bb0"
OpName %bb1 "bb1"
OpName %bb2 "bb2"
OpName %bb3 "bb3"
OpName %_ZN80__LT__u5b_f32_u3b__u20___u5d__u20_as_u20_issues__reference__Array_LT_f32_GT__GT_6length "_ZN80_$LT$$u5b$f32$u3b$$u20$_$u5d$$u20$as$u20$issues..reference..Array$LT$f32$GT$$GT$6length"
OpName %bb0_0 "bb0"
OpName %_ZN6issues9reference3sum "_ZN6issues9reference3sum"
OpName %bb0_1 "bb0"
OpName %bb1_0 "bb1"
OpName %bb2_0 "bb2"
OpName %bb8 "bb8"
OpName %bb4 "bb4"
OpName %bb5 "bb5"
OpName %bb6 "bb6"
OpName %bb7 "bb7"
OpName %bb3_0 "bb3"
OpDecorate %_runtimearr_float ArrayStride 4
OpMemberDecorate %_ZN9rlsl_math5entry6Buffer 0 Offset 0
OpMemberDecorate %_ZN9rlsl_math5entry7Compute 0 Offset 0
OpMemberDecorate %_ZN9rlsl_math5entry7Compute 1 Offset 16
OpDecorate %_ZN9rlsl_math5entry7Compute Block
OpMemberDecorate %_ZN9rlsl_math5entry7Compute 0 BuiltIn LocalInvocationIndex
OpMemberDecorate %_ZN9rlsl_math5entry7Compute 1 BuiltIn GlobalInvocationId
OpDecorate %10 DescriptorSet 0
OpDecorate %10 Binding 0
%bool = OpTypeBool
%float = OpTypeFloat 32
%_runtimearr_float = OpTypeRuntimeArray %float
%_ZN9rlsl_math5entry6Buffer = OpTypeStruct %_runtimearr_float
%_ptr_StorageBuffer__ZN9rlsl_math5entry6Buffer = OpTypePointer StorageBuffer %_ZN9rlsl_math5entry6Buffer
%10 = OpVariable %_ptr_StorageBuffer__ZN9rlsl_math5entry6Buffer StorageBuffer
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
%_ZN9rlsl_math5entry7Compute = OpTypeStruct %uint %v3uint
%_ptr_Input__ZN9rlsl_math5entry7Compute = OpTypePointer Input %_ZN9rlsl_math5entry7Compute
%15 = OpVariable %_ptr_Input__ZN9rlsl_math5entry7Compute Input
%void = OpTypeVoid
%17 = OpTypeFunction %void
%_ptr_Function_uint = OpTypePointer Function %uint
%_ptr_Function_float = OpTypePointer Function %float
%uint_2 = OpConstant %uint 2
%_arr_float_uint_2 = OpTypeArray %float %uint_2
%_ptr_Function__arr_float_uint_2 = OpTypePointer Function %_arr_float_uint_2
%_ptr_Function_void = OpTypePointer Function %void
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%_ptr_Input_uint = OpTypePointer Input %uint
%_ptr_Function__runtimearr_float = OpTypePointer Function %_runtimearr_float
%_ptr_StorageBuffer__runtimearr_float = OpTypePointer StorageBuffer %_runtimearr_float
%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
%float_2 = OpConstant %float 2
%69 = OpTypeFunction %uint %_ptr_Function__arr_float_uint_2
%_ptr_Function_uint_0 = OpTypePointer Function %uint
%76 = OpTypeFunction %float %_ptr_Function__arr_float_uint_2
%_ptr_Function_uint_1 = OpTypePointer Function %uint
%_struct_96 = OpTypeStruct %uint %uint
%_ptr_Function__struct_96 = OpTypePointer Function %_struct_96
%float_42 = OpConstant %float 42
%uint_0_0 = OpConstant %uint 0
%float_1 = OpConstant %float 1
%uint_1_0 = OpConstant %uint 1
%_struct_116 = OpTypeStruct %uint %uint
%3 = OpFunction %void None %17
%18 = OpLabel
%24 = OpVariable %_ptr_Function_uint Function
%25 = OpVariable %_ptr_Function_uint Function
%27 = OpVariable %_ptr_Function_float Function
%28 = OpVariable %_ptr_Function_uint Function
%29 = OpVariable %_ptr_Function_float Function
%30 = OpVariable %_ptr_Function_uint Function
%31 = OpVariable %_ptr_Function_uint Function
%35 = OpVariable %_ptr_Function__arr_float_uint_2 Function
%36 = OpVariable %_ptr_Function_float Function
%37 = OpVariable %_ptr_Function_float Function
%38 = OpVariable %_ptr_Function_float Function
%40 = OpVariable %_ptr_Function_void Function
OpBranch %bb0
%bb0 = OpLabel
%44 = OpAccessChain %_ptr_Input_uint %15 %uint_1 %uint_0
%45 = OpLoad %uint %44
OpStore %25 %45
%47 = OpLoad %uint %25
OpStore %28 %47
%49 = OpAccessChain %_ptr_StorageBuffer__runtimearr_float %10 %uint_0
%50 = OpLoad %uint %28
%52 = OpAccessChain %_ptr_StorageBuffer_float %49 %50
%53 = OpLoad %float %52
OpStore %27 %53
OpBranch %bb1
%bb1 = OpLabel
%54 = OpLoad %uint %25
OpStore %30 %54
%55 = OpLoad %float %27
OpStore %36 %55
%56 = OpLoad %float %27
OpStore %38 %56
%58 = OpLoad %float %38
%59 = OpFMul %float %float_2 %58
OpStore %37 %59
%60 = OpLoad %float %36
%61 = OpLoad %float %37
%62 = OpCompositeConstruct %_arr_float_uint_2 %60 %61
OpStore %35 %62
%63 = OpFunctionCall %float %_ZN6issues9reference3sum %35
OpStore %29 %63
OpBranch %bb2
%bb2 = OpLabel
%64 = OpLoad %uint %25
OpStore %31 %64
%65 = OpAccessChain %_ptr_StorageBuffer__runtimearr_float %10 %uint_0
%66 = OpLoad %uint %31
%67 = OpLoad %float %29
%68 = OpAccessChain %_ptr_StorageBuffer_float %65 %66
OpStore %68 %67
OpBranch %bb3
%bb3 = OpLabel
OpReturn
OpFunctionEnd
%_ZN80__LT__u5b_f32_u3b__u20___u5d__u20_as_u20_issues__reference__Array_LT_f32_GT__GT_6length = OpFunction %uint None %69
%70 = OpFunctionParameter %_ptr_Function__arr_float_uint_2
%71 = OpLabel
%73 = OpVariable %_ptr_Function_uint_0 Function
OpBranch %bb0_0
%bb0_0 = OpLabel
OpStore %73 %uint_2
%75 = OpLoad %uint %73
OpReturnValue %75
OpFunctionEnd
%_ZN6issues9reference3sum = OpFunction %float None %76
%77 = OpFunctionParameter %_ptr_Function__arr_float_uint_2
%78 = OpLabel
%79 = OpVariable %_ptr_Function_float Function
%89 = OpVariable %_ptr_Function_float Function
%90 = OpVariable %_ptr_Function_uint_0 Function
%91 = OpVariable %_ptr_Function_uint_0 Function
%93 = OpVariable %_ptr_Function_uint_1 Function
%94 = OpVariable %_ptr_Function_uint_0 Function
%95 = OpVariable %_ptr_Function_uint_0 Function
%98 = OpVariable %_ptr_Function__struct_96 Function
%99 = OpVariable %_ptr_Function_float Function
OpBranch %bb0_1
%bb0_1 = OpLabel
OpStore %89 %float_42
OpStore %90 %uint_0_0
%102 = OpFunctionCall %uint %_ZN80__LT__u5b_f32_u3b__u20___u5d__u20_as_u20_issues__reference__Array_LT_f32_GT__GT_6length %77
OpStore %91 %102
OpBranch %bb1_0
%bb1_0 = OpLabel
OpBranch %bb2_0
%bb2_0 = OpLabel
%103 = OpLoad %uint %90
OpStore %94 %103
%104 = OpFunctionCall %uint %_ZN80__LT__u5b_f32_u3b__u20___u5d__u20_as_u20_issues__reference__Array_LT_f32_GT__GT_6length %77
OpStore %95 %104
OpLoopMerge %bb8 %bb6 None
OpBranch %bb8
%bb8 = OpLabel
OpBranch %bb4
%bb4 = OpLabel
%105 = OpLoad %uint %94
%106 = OpLoad %uint %95
%107 = OpULessThan %bool %105 %106
%108 = OpSelect %uint %107 %uint_1 %uint_0
OpStore %93 %108
%109 = OpLoad %uint %93
%110 = OpINotEqual %bool %109 %uint_0
OpSelectionMerge %bb7 None
OpBranchConditional %110 %bb5 %bb7
%bb5 = OpLabel
%111 = OpLoad %float %89
%113 = OpFAdd %float %111 %float_1
OpStore %89 %113
%114 = OpLoad %uint %90
%117 = OpIAddCarry %_struct_116 %114 %uint_1_0
%118 = OpCompositeExtract %uint %117 0
%119 = OpCompositeExtract %uint %117 1
%120 = OpBitcast %uint %119
%121 = OpCompositeConstruct %_struct_96 %118 %119
OpStore %98 %121
OpBranch %bb6
%bb6 = OpLabel
%122 = OpAccessChain %_ptr_Function_uint_0 %98 %uint_0
%123 = OpLoad %uint %122
OpStore %90 %123
OpBranch %bb2_0
%bb7 = OpLabel
OpBranch %bb3_0
%bb3_0 = OpLabel
%124 = OpLoad %float %89
OpStore %99 %124
%125 = OpLoad %float %99
OpStore %79 %125
%126 = OpLoad %float %79
OpReturnValue %126
OpFunctionEnd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment