1deee662创建于 2025年8月1日历史提交
rayQuery-allOps.comp
// Module Version 10000
// Generated by (magic number): 8000b
// Id's are bound by 275

                              Capability Shader
                              Capability RayQueryKHR
                              Capability RayTraversalPrimitiveCullingKHR
                              Capability RayQueryPositionFetchKHR
                              Extension  "SPV_KHR_ray_query"
                              Extension  "SPV_KHR_ray_tracing_position_fetch"
               1:             ExtInstImport  "GLSL.std.450"
                              MemoryModel Logical GLSL450
                              EntryPoint GLCompute 4  "main"
                              ExecutionMode 4 LocalSize 1 1 1
                              Source GLSL 460
                              SourceExtension  "GL_EXT_ray_flags_primitive_culling"
                              SourceExtension  "GL_EXT_ray_query"
                              SourceExtension  "GL_EXT_ray_tracing_position_fetch"
                              Name 4  "main"
                              Name 6  "doSomething("
                              Name 10  "Ray"
                              MemberName 10(Ray) 0  "pos"
                              MemberName 10(Ray) 1  "tmin"
                              MemberName 10(Ray) 2  "dir"
                              MemberName 10(Ray) 3  "tmax"
                              Name 12  "makeRayDesc("
                              Name 15  "Log"
                              MemberName 15(Log) 0  "x"
                              MemberName 15(Log) 1  "y"
                              Name 17  ""
                              Name 26  "ray"
                              Name 43  "ray"
                              Name 47  "rayQuery"
                              Name 50  "rtas"
                              Name 69  "candidateType"
                              Name 78  "_mat4x3"
                              Name 83  "_mat3x4"
                              Name 143  "t"
                              Name 156  "committedStatus"
                              Name 184  "positions"
                              Name 258  "o"
                              Name 260  "d"
                              Name 270  "Ray"
                              MemberName 270(Ray) 0  "pos"
                              MemberName 270(Ray) 1  "tmin"
                              MemberName 270(Ray) 2  "dir"
                              MemberName 270(Ray) 3  "tmax"
                              Name 272  "Rays"
                              MemberName 272(Rays) 0  "rays"
                              Name 274  ""
                              Decorate 15(Log) BufferBlock
                              MemberDecorate 15(Log) 0 Offset 0
                              MemberDecorate 15(Log) 1 Offset 4
                              Decorate 17 Binding 0
                              Decorate 17 DescriptorSet 0
                              Decorate 50(rtas) Binding 1
                              Decorate 50(rtas) DescriptorSet 0
                              MemberDecorate 270(Ray) 0 Offset 0
                              MemberDecorate 270(Ray) 1 Offset 12
                              MemberDecorate 270(Ray) 2 Offset 16
                              MemberDecorate 270(Ray) 3 Offset 28
                              Decorate 271 ArrayStride 32
                              Decorate 272(Rays) BufferBlock
                              MemberDecorate 272(Rays) 0 Offset 0
                              Decorate 274 Binding 2
                              Decorate 274 DescriptorSet 0
               2:             TypeVoid
               3:             TypeFunction 2
               8:             TypeFloat 32
               9:             TypeVector 8(float) 3
         10(Ray):             TypeStruct 9(fvec3) 8(float) 9(fvec3) 8(float)
              11:             TypeFunction 10(Ray)
              14:             TypeInt 32 0
         15(Log):             TypeStruct 14(int) 14(int)
              16:             TypePointer Uniform 15(Log)
              17:     16(ptr) Variable Uniform
              18:             TypeInt 32 1
              19:     18(int) Constant 0
              20:     14(int) Constant 0
              21:             TypePointer Uniform 14(int)
              23:     18(int) Constant 1
              25:             TypePointer Function 10(Ray)
              27:    8(float) Constant 0
              28:    9(fvec3) ConstantComposite 27 27 27
              29:             TypePointer Function 9(fvec3)
              31:     18(int) Constant 2
              32:    8(float) Constant 1065353216
              33:    9(fvec3) ConstantComposite 32 27 27
              35:             TypePointer Function 8(float)
              37:     18(int) Constant 3
              38:    8(float) Constant 1176255488
              45:             TypeRayQueryKHR
              46:             TypePointer Private 45
    47(rayQuery):     46(ptr) Variable Private
              48:             TypeAccelerationStructureKHR
              49:             TypePointer UniformConstant 48
        50(rtas):     49(ptr) Variable UniformConstant
              52:     14(int) Constant 255
              66:             TypeBool
              68:             TypePointer Function 14(int)
              70:    66(bool) ConstantFalse
              76:             TypeMatrix 9(fvec3) 4
              77:             TypePointer Function 76
              80:             TypeVector 8(float) 4
              81:             TypeMatrix 80(fvec4) 3
              82:             TypePointer Function 81
              86:    66(bool) ConstantTrue
              91:             TypeVector 8(float) 2
             144:    8(float) Constant 1056964608
             175:     14(int) Constant 1
             181:     14(int) Constant 3
             182:             TypeArray 9(fvec3) 181
             183:             TypePointer Function 182
             215:     14(int) Constant 2
             248:     14(int) Constant 256
        270(Ray):             TypeStruct 9(fvec3) 8(float) 9(fvec3) 8(float)
             271:             TypeRuntimeArray 270(Ray)
       272(Rays):             TypeStruct 271
             273:             TypePointer Uniform 272(Rays)
             274:    273(ptr) Variable Uniform
         4(main):           2 Function None 3
               5:             Label
         43(ray):     25(ptr) Variable Function
69(candidateType):     68(ptr) Variable Function
     78(_mat4x3):     77(ptr) Variable Function
     83(_mat3x4):     82(ptr) Variable Function
          143(t):     35(ptr) Variable Function
156(committedStatus):     68(ptr) Variable Function
  184(positions):    183(ptr) Variable Function
          258(o):     29(ptr) Variable Function
          260(d):     29(ptr) Variable Function
              44:     10(Ray) FunctionCall 12(makeRayDesc()
                              Store 43(ray) 44
              51:          48 Load 50(rtas)
              53:     29(ptr) AccessChain 43(ray) 19
              54:    9(fvec3) Load 53
              55:     35(ptr) AccessChain 43(ray) 23
              56:    8(float) Load 55
              57:     29(ptr) AccessChain 43(ray) 31
              58:    9(fvec3) Load 57
              59:     35(ptr) AccessChain 43(ray) 37
              60:    8(float) Load 59
                              RayQueryInitializeKHR 47(rayQuery) 51 20 52 54 56 58 60
                              Branch 61
              61:             Label
                              LoopMerge 63 64 None
                              Branch 65
              65:             Label
              67:    66(bool) RayQueryProceedKHR 47(rayQuery)
                              BranchConditional 67 62 63
              62:               Label
              71:     14(int)   RayQueryGetIntersectionTypeKHR 47(rayQuery) 19
                                Store 69(candidateType) 71
              72:     14(int)   Load 69(candidateType)
                                SelectionMerge 75 None
                                Switch 72 75 
                                       case 0: 73
                                       case 1: 74
              73:                 Label
                                  RayQueryTerminateKHR 47(rayQuery)
              79:          76     RayQueryGetIntersectionObjectToWorldKHR 47(rayQuery) 19
                                  Store 78(_mat4x3) 79
              84:          76     Load 78(_mat4x3)
              85:          81     Transpose 84
                                  Store 83(_mat3x4) 85
                                  RayQueryConfirmIntersectionKHR 47(rayQuery)
              87:    66(bool)     RayQueryGetIntersectionFrontFaceKHR 47(rayQuery) 23
                                  SelectionMerge 89 None
                                  BranchConditional 87 88 89
              88:                   Label
              90:           2       FunctionCall 6(doSomething()
                                    Branch 89
              89:                 Label
              92:   91(fvec2)     RayQueryGetIntersectionBarycentricsKHR 47(rayQuery) 23
              93:    8(float)     CompositeExtract 92 0
              94:    66(bool)     FOrdEqual 93 27
                                  SelectionMerge 96 None
                                  BranchConditional 94 95 96
              95:                   Label
              97:           2       FunctionCall 6(doSomething()
                                    Branch 96
              96:                 Label
              98:     18(int)     RayQueryGetIntersectionInstanceCustomIndexKHR 47(rayQuery) 23
              99:    66(bool)     SGreaterThan 98 19
                                  SelectionMerge 101 None
                                  BranchConditional 99 100 101
             100:                   Label
             102:           2       FunctionCall 6(doSomething()
                                    Branch 101
             101:                 Label
             103:     18(int)     RayQueryGetIntersectionInstanceIdKHR 47(rayQuery) 23
             104:    66(bool)     SGreaterThan 103 19
                                  SelectionMerge 106 None
                                  BranchConditional 104 105 106
             105:                   Label
             107:           2       FunctionCall 6(doSomething()
                                    Branch 106
             106:                 Label
             108:    9(fvec3)     RayQueryGetIntersectionObjectRayDirectionKHR 47(rayQuery) 23
             109:    8(float)     CompositeExtract 108 0
             110:    66(bool)     FOrdGreaterThan 109 27
                                  SelectionMerge 112 None
                                  BranchConditional 110 111 112
             111:                   Label
             113:           2       FunctionCall 6(doSomething()
                                    Branch 112
             112:                 Label
             114:    9(fvec3)     RayQueryGetIntersectionObjectRayOriginKHR 47(rayQuery) 23
             115:    8(float)     CompositeExtract 114 0
             116:    66(bool)     FOrdGreaterThan 115 27
                                  SelectionMerge 118 None
                                  BranchConditional 116 117 118
             117:                   Label
             119:           2       FunctionCall 6(doSomething()
                                    Branch 118
             118:                 Label
             120:     18(int)     RayQueryGetIntersectionPrimitiveIndexKHR 47(rayQuery) 23
             121:    66(bool)     SGreaterThan 120 19
                                  SelectionMerge 123 None
                                  BranchConditional 121 122 123
             122:                   Label
             124:           2       FunctionCall 6(doSomething()
                                    Branch 123
             123:                 Label
             125:    8(float)     RayQueryGetIntersectionTKHR 47(rayQuery) 23
             126:    66(bool)     FOrdGreaterThan 125 27
                                  SelectionMerge 128 None
                                  BranchConditional 126 127 128
             127:                   Label
             129:           2       FunctionCall 6(doSomething()
                                    Branch 128
             128:                 Label
             130:     14(int)     RayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR 47(rayQuery) 23
             131:    66(bool)     UGreaterThan 130 20
                                  SelectionMerge 133 None
                                  BranchConditional 131 132 133
             132:                   Label
             134:           2       FunctionCall 6(doSomething()
                                    Branch 133
             133:                 Label
                                  Branch 75
              74:                 Label
             136:          76     RayQueryGetIntersectionObjectToWorldKHR 47(rayQuery) 19
                                  Store 78(_mat4x3) 136
             137:          76     Load 78(_mat4x3)
             138:          81     Transpose 137
                                  Store 83(_mat3x4) 138
             139:    66(bool)     RayQueryGetIntersectionCandidateAABBOpaqueKHR 47(rayQuery)
                                  SelectionMerge 141 None
                                  BranchConditional 139 140 141
             140:                   Label
             142:           2       FunctionCall 6(doSomething()
                                    Branch 141
             141:                 Label
                                  Store 143(t) 144
             145:    8(float)     Load 143(t)
                                  RayQueryGenerateIntersectionKHR 47(rayQuery) 145
                                  RayQueryTerminateKHR 47(rayQuery)
                                  Branch 75
              75:               Label
                                Branch 64
              64:               Label
                                Branch 61
              63:             Label
             148:     35(ptr) AccessChain 83(_mat3x4) 19 20
             149:    8(float) Load 148
             150:     35(ptr) AccessChain 78(_mat4x3) 19 20
             151:    8(float) Load 150
             152:    66(bool) FOrdEqual 149 151
                              SelectionMerge 154 None
                              BranchConditional 152 153 154
             153:               Label
             155:           2   FunctionCall 6(doSomething()
                                Branch 154
             154:             Label
             157:     14(int) RayQueryGetIntersectionTypeKHR 47(rayQuery) 23
                              Store 156(committedStatus) 157
             158:     14(int) Load 156(committedStatus)
                              SelectionMerge 162 None
                              Switch 158 162 
                                     case 0: 159
                                     case 1: 160
                                     case 2: 161
             159:               Label
             163:          76   RayQueryGetIntersectionWorldToObjectKHR 47(rayQuery) 19
                                Store 78(_mat4x3) 163
             164:          76   Load 78(_mat4x3)
             165:          81   Transpose 164
                                Store 83(_mat3x4) 165
                                Branch 162
             160:               Label
             167:          76   RayQueryGetIntersectionWorldToObjectKHR 47(rayQuery) 23
                                Store 78(_mat4x3) 167
             168:          76   Load 78(_mat4x3)
             169:          81   Transpose 168
                                Store 83(_mat3x4) 169
             170:    66(bool)   RayQueryGetIntersectionFrontFaceKHR 47(rayQuery) 23
                                SelectionMerge 172 None
                                BranchConditional 170 171 172
             171:                 Label
             173:           2     FunctionCall 6(doSomething()
                                  Branch 172
             172:               Label
             174:   91(fvec2)   RayQueryGetIntersectionBarycentricsKHR 47(rayQuery) 23
             176:    8(float)   CompositeExtract 174 1
             177:    66(bool)   FOrdEqual 176 27
                                SelectionMerge 179 None
                                BranchConditional 177 178 179
             178:                 Label
             180:           2     FunctionCall 6(doSomething()
                                  Branch 179
             179:               Label
             185:         182   RayQueryGetIntersectionTriangleVertexPositionsKHR 47(rayQuery) 23
                                Store 184(positions) 185
             186:     35(ptr)   AccessChain 184(positions) 19 20
             187:    8(float)   Load 186
             188:    66(bool)   FOrdLessThan 187 27
                                SelectionMerge 190 None
                                BranchConditional 188 189 190
             189:                 Label
             191:     35(ptr)     AccessChain 184(positions) 31 175
             192:    8(float)     Load 191
             193:    66(bool)     FOrdGreaterThan 192 27
                                  Branch 190
             190:               Label
             194:    66(bool)   Phi 188 179 193 189
                                SelectionMerge 196 None
                                BranchConditional 194 195 196
             195:                 Label
             197:           2     FunctionCall 6(doSomething()
                                  Branch 196
             196:               Label
                                Branch 162
             161:               Label
             199:     18(int)   RayQueryGetIntersectionGeometryIndexKHR 47(rayQuery) 23
             200:    66(bool)   SGreaterThan 199 19
                                SelectionMerge 202 None
                                BranchConditional 200 201 202
             201:                 Label
             203:           2     FunctionCall 6(doSomething()
                                  Branch 202
             202:               Label
             204:     18(int)   RayQueryGetIntersectionInstanceIdKHR 47(rayQuery) 23
             205:    66(bool)   SGreaterThan 204 19
                                SelectionMerge 207 None
                                BranchConditional 205 206 207
             206:                 Label
             208:           2     FunctionCall 6(doSomething()
                                  Branch 207
             207:               Label
             209:     18(int)   RayQueryGetIntersectionInstanceCustomIndexKHR 47(rayQuery) 23
             210:    66(bool)   SGreaterThan 209 19
                                SelectionMerge 212 None
                                BranchConditional 210 211 212
             211:                 Label
             213:           2     FunctionCall 6(doSomething()
                                  Branch 212
             212:               Label
             214:    9(fvec3)   RayQueryGetIntersectionObjectRayDirectionKHR 47(rayQuery) 23
             216:    8(float)   CompositeExtract 214 2
             217:    66(bool)   FOrdGreaterThan 216 27
                                SelectionMerge 219 None
                                BranchConditional 217 218 219
             218:                 Label
             220:           2     FunctionCall 6(doSomething()
                                  Branch 219
             219:               Label
             221:    9(fvec3)   RayQueryGetIntersectionObjectRayOriginKHR 47(rayQuery) 23
             222:    8(float)   CompositeExtract 221 0
             223:    66(bool)   FOrdGreaterThan 222 27
                                SelectionMerge 225 None
                                BranchConditional 223 224 225
             224:                 Label
             226:           2     FunctionCall 6(doSomething()
                                  Branch 225
             225:               Label
             227:     18(int)   RayQueryGetIntersectionPrimitiveIndexKHR 47(rayQuery) 23
             228:    66(bool)   SGreaterThan 227 19
                                SelectionMerge 230 None
                                BranchConditional 228 229 230
             229:                 Label
             231:           2     FunctionCall 6(doSomething()
                                  Branch 230
             230:               Label
             232:    8(float)   RayQueryGetIntersectionTKHR 47(rayQuery) 23
             233:    66(bool)   FOrdGreaterThan 232 27
                                SelectionMerge 235 None
                                BranchConditional 233 234 235
             234:                 Label
             236:           2     FunctionCall 6(doSomething()
                                  Branch 235
             235:               Label
                                Branch 162
             162:             Label
             239:     35(ptr) AccessChain 83(_mat3x4) 19 20
             240:    8(float) Load 239
             241:     35(ptr) AccessChain 78(_mat4x3) 19 20
             242:    8(float) Load 241
             243:    66(bool) FOrdEqual 240 242
                              SelectionMerge 245 None
                              BranchConditional 243 244 245
             244:               Label
             246:           2   FunctionCall 6(doSomething()
                                Branch 245
             245:             Label
             247:     14(int) RayQueryGetRayFlagsKHR 47(rayQuery)
             249:    66(bool) UGreaterThan 247 248
                              SelectionMerge 251 None
                              BranchConditional 249 250 251
             250:               Label
             252:           2   FunctionCall 6(doSomething()
                                Branch 251
             251:             Label
             253:    8(float) RayQueryGetRayTMinKHR 47(rayQuery)
             254:    66(bool) FOrdGreaterThan 253 27
                              SelectionMerge 256 None
                              BranchConditional 254 255 256
             255:               Label
             257:           2   FunctionCall 6(doSomething()
                                Branch 256
             256:             Label
             259:    9(fvec3) RayQueryGetWorldRayOriginKHR 47(rayQuery)
                              Store 258(o) 259
             261:    9(fvec3) RayQueryGetWorldRayDirectionKHR 47(rayQuery)
                              Store 260(d) 261
             262:     35(ptr) AccessChain 258(o) 20
             263:    8(float) Load 262
             264:     35(ptr) AccessChain 260(d) 215
             265:    8(float) Load 264
             266:    66(bool) FOrdEqual 263 265
                              SelectionMerge 268 None
                              BranchConditional 266 267 268
             267:               Label
             269:           2   FunctionCall 6(doSomething()
                                Branch 268
             268:             Label
                              Return
                              FunctionEnd
 6(doSomething():           2 Function None 3
               7:             Label
              22:     21(ptr) AccessChain 17 19
                              Store 22 20
              24:     21(ptr) AccessChain 17 23
                              Store 24 20
                              Return
                              FunctionEnd
12(makeRayDesc():     10(Ray) Function None 11
              13:             Label
         26(ray):     25(ptr) Variable Function
              30:     29(ptr) AccessChain 26(ray) 19
                              Store 30 28
              34:     29(ptr) AccessChain 26(ray) 31
                              Store 34 33
              36:     35(ptr) AccessChain 26(ray) 23
                              Store 36 27
              39:     35(ptr) AccessChain 26(ray) 37
                              Store 39 38
              40:     10(Ray) Load 26(ray)
                              ReturnValue 40
                              FunctionEnd