Skip to content

Instantly share code, notes, and snippets.

@pashu123
Created February 10, 2023 17:23
Show Gist options
  • Save pashu123/688e7ae98f414ecc36721db1f31ec522 to your computer and use it in GitHub Desktop.
Save pashu123/688e7ae98f414ecc36721db1f31ec522 to your computer and use it in GitHub Desktop.
; SPIR-V
; Version: 1.3
; Generator: Khronos; 22
; Bound: 132
; Schema: 0
OpCapability Shader
OpCapability GroupNonUniformShuffle
OpExtension "SPV_KHR_storage_buffer_storage_class"
%98 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %forward_dispatch_43_generic_10x9216x9216 "forward_dispatch_43_generic_10x9216x9216" %__builtin_var_LocalInvocationId__ %__builtin_var_WorkgroupId__
OpExecutionMode %forward_dispatch_43_generic_10x9216x9216 LocalSize 256 1 1
OpName %__workgroup_mem__4 "__workgroup_mem__4"
OpName %__builtin_var_WorkgroupId__ "__builtin_var_WorkgroupId__"
OpName %__builtin_var_LocalInvocationId__ "__builtin_var_LocalInvocationId__"
OpName %__resource_var_0_0_ "__resource_var_0_0_"
OpName %__resource_var_0_1_ "__resource_var_0_1_"
OpName %forward_dispatch_43_generic_10x9216x9216 "forward_dispatch_43_generic_10x9216x9216"
OpDecorate %__builtin_var_WorkgroupId__ BuiltIn WorkgroupId
OpDecorate %__builtin_var_LocalInvocationId__ BuiltIn LocalInvocationId
OpDecorate %_runtimearr_v4float ArrayStride 16
OpMemberDecorate %_struct_13 0 Offset 0
OpDecorate %_struct_13 Block
OpDecorate %__resource_var_0_0_ Binding 0
OpDecorate %__resource_var_0_0_ DescriptorSet 0
OpDecorate %__resource_var_0_1_ Binding 1
OpDecorate %__resource_var_0_1_ DescriptorSet 0
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%uint_8 = OpConstant %uint 8
%_arr_float_uint_8 = OpTypeArray %float %uint_8
%_struct_2 = OpTypeStruct %_arr_float_uint_8
%_ptr_Workgroup__struct_2 = OpTypePointer Workgroup %_struct_2
%__workgroup_mem__4 = OpVariable %_ptr_Workgroup__struct_2 Workgroup
%v3uint = OpTypeVector %uint 3
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
%__builtin_var_WorkgroupId__ = OpVariable %_ptr_Input_v3uint Input
%__builtin_var_LocalInvocationId__ = OpVariable %_ptr_Input_v3uint Input
%v4float = OpTypeVector %float 4
%_runtimearr_v4float = OpTypeRuntimeArray %v4float
%_struct_13 = OpTypeStruct %_runtimearr_v4float
%_ptr_StorageBuffer__struct_13 = OpTypePointer StorageBuffer %_struct_13
%__resource_var_0_0_ = OpVariable %_ptr_StorageBuffer__struct_13 StorageBuffer
%__resource_var_0_1_ = OpVariable %_ptr_StorageBuffer__struct_13 StorageBuffer
%void = OpTypeVoid
%18 = OpTypeFunction %void
%uint_218234880 = OpConstant %uint 218234880
%uint_2304 = OpConstant %uint 2304
%uint_21233664 = OpConstant %uint 21233664
%uint_4294967295 = OpConstant %uint 4294967295
%uint_4 = OpConstant %uint 4
%uint_0 = OpConstant %uint 0
%float_0 = OpConstant %float 0
%28 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
%uint_32 = OpConstant %uint 32
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%uint_16 = OpConstant %uint 16
%uint_7 = OpConstant %uint 7
%uint_1024 = OpConstant %uint 1024
%uint_9216 = OpConstant %uint 9216
%_ptr_Function_v4float = OpTypePointer Function %v4float
%bool = OpTypeBool
%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
%uint_3 = OpConstant %uint 3
%_ptr_Workgroup_float = OpTypePointer Workgroup %float
%uint_264 = OpConstant %uint 264
%forward_dispatch_43_generic_10x9216x9216 = OpFunction %void None %18
%21 = OpLabel
%44 = OpVariable %_ptr_Function_v4float Function
%37 = OpLoad %v3uint %__builtin_var_LocalInvocationId__
%38 = OpCompositeExtract %uint %37 0
%39 = OpLoad %v3uint %__builtin_var_WorkgroupId__
%40 = OpCompositeExtract %uint %39 0
%41 = OpLoad %v3uint %__builtin_var_WorkgroupId__
%42 = OpCompositeExtract %uint %41 1
OpBranch %45
%45 = OpLabel
%48 = OpPhi %uint %68 %46 %uint_0 %21
%49 = OpPhi %v4float %67 %46 %28 %21
%51 = OpSLessThan %bool %48 %uint_9216
OpLoopMerge %47 %46 None
OpBranchConditional %51 %46 %47
%46 = OpLabel
%52 = OpSLessThan %bool %48 %uint_0
%53 = OpISub %uint %uint_4294967295 %48
%54 = OpSelect %uint %52 %53 %48
%55 = OpSDiv %uint %54 %uint_4
%56 = OpISub %uint %uint_4294967295 %55
%57 = OpSelect %uint %52 %56 %55
%58 = OpIMul %uint %42 %uint_21233664
%59 = OpIAdd %uint %38 %58
%60 = OpIMul %uint %40 %uint_2304
%61 = OpIAdd %uint %59 %60
%62 = OpIAdd %uint %57 %61
%63 = OpIAdd %uint %62 %uint_218234880
%65 = OpAccessChain %_ptr_StorageBuffer_v4float %__resource_var_0_0_ %uint_0 %63
%66 = OpLoad %v4float %65
%67 = OpFAdd %v4float %66 %49
OpStore %44 %67
%68 = OpIAdd %uint %48 %uint_1024
OpBranch %45
%47 = OpLabel
%69 = OpLoad %v4float %44
%70 = OpCompositeExtract %float %69 0
%71 = OpCompositeExtract %float %69 1
%72 = OpCompositeExtract %float %69 2
%73 = OpCompositeExtract %float %69 3
%74 = OpFAdd %float %70 %71
%75 = OpFAdd %float %74 %72
%76 = OpFAdd %float %75 %73
%77 = OpGroupNonUniformShuffleXor %float %uint_3 %76 %uint_1
%79 = OpFAdd %float %76 %77
%80 = OpGroupNonUniformShuffleXor %float %uint_3 %79 %uint_2
%81 = OpFAdd %float %79 %80
%82 = OpGroupNonUniformShuffleXor %float %uint_3 %81 %uint_4
%83 = OpFAdd %float %81 %82
%84 = OpGroupNonUniformShuffleXor %float %uint_3 %83 %uint_8
%85 = OpFAdd %float %83 %84
%86 = OpGroupNonUniformShuffleXor %float %uint_3 %85 %uint_16
%87 = OpFAdd %float %85 %86
%88 = OpUDiv %uint %38 %uint_32
%89 = OpUMod %uint %38 %uint_32
%90 = OpIEqual %bool %89 %uint_0
OpBranch %91
%91 = OpLabel
OpSelectionMerge %93 None
OpBranchConditional %90 %92 %93
%92 = OpLabel
%95 = OpAccessChain %_ptr_Workgroup_float %__workgroup_mem__4 %uint_0 %88
OpStore %95 %87
OpBranch %93
%93 = OpLabel
OpControlBarrier %uint_2 %uint_2 %uint_264
%97 = OpExtInst %uint %98 UMin %89 %uint_7
%99 = OpAccessChain %_ptr_Workgroup_float %__workgroup_mem__4 %uint_0 %97
%100 = OpLoad %float %99
%101 = OpGroupNonUniformShuffleXor %float %uint_3 %100 %uint_1
%102 = OpFAdd %float %100 %101
%103 = OpGroupNonUniformShuffleXor %float %uint_3 %102 %uint_2
%104 = OpFAdd %float %102 %103
%105 = OpGroupNonUniformShuffleXor %float %uint_3 %104 %uint_4
%106 = OpFAdd %float %104 %105
%107 = OpGroupNonUniformShuffle %float %uint_3 %106 %uint_0
%108 = OpFAdd %float %107 %float_0
%109 = OpCompositeConstruct %v4float %108 %108 %108 %108
OpBranch %110
%110 = OpLabel
%113 = OpPhi %uint %131 %111 %uint_0 %93
%114 = OpSLessThan %bool %113 %uint_9216
OpLoopMerge %112 %111 None
OpBranchConditional %114 %111 %112
%111 = OpLabel
%115 = OpSLessThan %bool %113 %uint_0
%116 = OpISub %uint %uint_4294967295 %113
%117 = OpSelect %uint %115 %116 %113
%118 = OpSDiv %uint %117 %uint_4
%119 = OpISub %uint %uint_4294967295 %118
%120 = OpSelect %uint %115 %119 %118
%121 = OpIMul %uint %42 %uint_21233664
%122 = OpIAdd %uint %38 %121
%123 = OpIMul %uint %40 %uint_2304
%124 = OpIAdd %uint %122 %123
%125 = OpIAdd %uint %120 %124
%126 = OpIAdd %uint %125 %uint_218234880
%127 = OpAccessChain %_ptr_StorageBuffer_v4float %__resource_var_0_0_ %uint_0 %126
%128 = OpLoad %v4float %127
%129 = OpFDiv %v4float %128 %109
%130 = OpAccessChain %_ptr_StorageBuffer_v4float %__resource_var_0_1_ %uint_0 %125
OpStore %130 %129
%131 = OpIAdd %uint %113 %uint_1024
OpBranch %110
%112 = OpLabel
OpReturn
OpFunctionEnd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment