Skip to content

Instantly share code, notes, and snippets.

@MaikKlein
Created October 2, 2018 16:15
Show Gist options
  • Save MaikKlein/24f7fc6f1a2cca2cde785a7b930fe97c to your computer and use it in GitHub Desktop.
Save MaikKlein/24f7fc6f1a2cca2cde785a7b930fe97c to your computer and use it in GitHub Desktop.
; SPIR-V
; Version: 1.0
; Generator: Google rspirv; 0
; Bound: 120
; 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 %bb7 "bb7"
OpName %bb3_0 "bb3"
OpName %bb4 "bb4"
OpName %bb5 "bb5"
OpName %bb6 "bb6"
OpName %bb2_0 "bb2"
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_94 = OpTypeStruct %uint %uint
%_ptr_Function__struct_94 = OpTypePointer Function %_struct_94
%float_42 = OpConstant %float 42
%uint_0_0 = OpConstant %uint 0
%float_1 = OpConstant %float 1
%uint_1_0 = OpConstant %uint 1
%_struct_113 = 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
%88 = OpVariable %_ptr_Function_float Function
%89 = OpVariable %_ptr_Function_uint_0 Function
%91 = OpVariable %_ptr_Function_uint_1 Function
%92 = OpVariable %_ptr_Function_uint_0 Function
%93 = OpVariable %_ptr_Function_uint_0 Function
%96 = OpVariable %_ptr_Function__struct_94 Function
%97 = OpVariable %_ptr_Function_float Function
OpBranch %bb0_1
%bb0_1 = OpLabel
OpStore %88 %float_42
OpStore %89 %uint_0_0
OpBranch %bb1_0
%bb1_0 = OpLabel
%100 = OpLoad %uint %89
OpStore %92 %100
%101 = OpFunctionCall %uint %_ZN80__LT__u5b_f32_u3b__u20___u5d__u20_as_u20_issues__reference__Array_LT_f32_GT__GT_6length %77
OpStore %93 %101
OpLoopMerge %bb7 %bb5 None
OpBranch %bb7
%bb7 = OpLabel
OpBranch %bb3_0
%bb3_0 = OpLabel
%102 = OpLoad %uint %92
%103 = OpLoad %uint %93
%104 = OpULessThan %bool %102 %103
%105 = OpSelect %uint %104 %uint_1 %uint_0
OpStore %91 %105
%106 = OpLoad %uint %91
%107 = OpINotEqual %bool %106 %uint_0
OpSelectionMerge %bb6 None
OpBranchConditional %107 %bb4 %bb6
%bb4 = OpLabel
%108 = OpLoad %float %88
%110 = OpFAdd %float %108 %float_1
OpStore %88 %110
%111 = OpLoad %uint %89
%114 = OpIAddCarry %_struct_113 %111 %uint_1_0
OpStore %96 %114
OpBranch %bb5
%bb5 = OpLabel
%115 = OpAccessChain %_ptr_Function_uint_0 %96 %uint_0
%116 = OpLoad %uint %115
OpStore %89 %116
OpBranch %bb1_0
%bb6 = OpLabel
OpBranch %bb2_0
%bb2_0 = OpLabel
%117 = OpLoad %float %88
OpStore %97 %117
%118 = OpLoad %float %97
OpStore %79 %118
%119 = OpLoad %float %79
OpReturnValue %119
OpFunctionEnd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment