| ; SPIR-V |
| ; Version: 1.3 |
| ; Generator: Google Tint Compiler; 0 |
| ; Bound: 46 |
| ; Schema: 0 |
| OpCapability Shader |
| %22 = OpExtInstImport "GLSL.std.450" |
| OpMemoryModel Logical GLSL450 |
| OpEntryPoint GLCompute %main "main" %idx_1 |
| OpExecutionMode %main LocalSize 1 1 1 |
| OpName %idx_1 "idx_1" |
| OpName %io_block "io_block" |
| OpMemberName %io_block 0 "inner" |
| OpName %S "S" |
| OpMemberName %S 0 "v" |
| OpMemberName %S 1 "i" |
| OpName %io "io" |
| OpName %Bad "Bad" |
| OpName %index "index" |
| OpName %rd "rd" |
| OpName %normal "normal" |
| OpName %main_inner "main_inner" |
| OpName %idx "idx" |
| OpName %main "main" |
| OpDecorate %idx_1 BuiltIn LocalInvocationIndex |
| OpDecorate %io_block Block |
| OpMemberDecorate %io_block 0 Offset 0 |
| OpMemberDecorate %S 0 Offset 0 |
| OpMemberDecorate %S 1 Offset 12 |
| OpDecorate %io Binding 0 |
| OpDecorate %io DescriptorSet 0 |
| %uint = OpTypeInt 32 0 |
| %_ptr_Input_uint = OpTypePointer Input %uint |
| %idx_1 = OpVariable %_ptr_Input_uint Input |
| %float = OpTypeFloat 32 |
| %v3float = OpTypeVector %float 3 |
| %S = OpTypeStruct %v3float %uint |
| %io_block = OpTypeStruct %S |
| %_ptr_StorageBuffer_io_block = OpTypePointer StorageBuffer %io_block |
| %io = OpVariable %_ptr_StorageBuffer_io_block StorageBuffer |
| %10 = OpTypeFunction %v3float %uint %v3float |
| %15 = OpConstantNull %v3float |
| %_ptr_Function_v3float = OpTypePointer Function %v3float |
| %_ptr_Function_float = OpTypePointer Function %float |
| %void = OpTypeVoid |
| %26 = OpTypeFunction %void %uint |
| %uint_0 = OpConstant %uint 0 |
| %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float |
| %uint_1 = OpConstant %uint 1 |
| %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint |
| %41 = OpTypeFunction %void |
| %Bad = OpFunction %v3float None %10 |
| %index = OpFunctionParameter %uint |
| %rd = OpFunctionParameter %v3float |
| %14 = OpLabel |
| %normal = OpVariable %_ptr_Function_v3float Function %15 |
| OpStore %normal %15 |
| %19 = OpAccessChain %_ptr_Function_float %normal %index |
| %23 = OpVectorExtractDynamic %float %rd %index |
| %21 = OpExtInst %float %22 FSign %23 |
| %20 = OpFNegate %float %21 |
| OpStore %19 %20 |
| %25 = OpLoad %v3float %normal |
| %24 = OpExtInst %v3float %22 Normalize %25 |
| OpReturnValue %24 |
| OpFunctionEnd |
| %main_inner = OpFunction %void None %26 |
| %idx = OpFunctionParameter %uint |
| %30 = OpLabel |
| %33 = OpAccessChain %_ptr_StorageBuffer_v3float %io %uint_0 %uint_0 |
| %37 = OpAccessChain %_ptr_StorageBuffer_uint %io %uint_0 %uint_1 |
| %38 = OpLoad %uint %37 |
| %39 = OpAccessChain %_ptr_StorageBuffer_v3float %io %uint_0 %uint_0 |
| %40 = OpLoad %v3float %39 |
| %34 = OpFunctionCall %v3float %Bad %38 %40 |
| OpStore %33 %34 |
| OpReturn |
| OpFunctionEnd |
| %main = OpFunction %void None %41 |
| %43 = OpLabel |
| %45 = OpLoad %uint %idx_1 |
| %44 = OpFunctionCall %void %main_inner %45 |
| OpReturn |
| OpFunctionEnd |