|
| 1 | +; BEGIN_SHADERTEST |
| 2 | +; RUN: amdllpc -v %gfxip %s | FileCheck -check-prefix=SHADERTEST %s |
| 3 | +; SHADERTEST-LABEL: {{^// LLPC}} pipeline before-patching results |
| 4 | +; SHADERTEST: call <3 x i32> @lgc.shader.input.WorkgroupId(i32 0) #1 |
| 5 | +; SHADERTEST: %{{[0-9]*}} = mul <3 x i32> %{{[0-9]*}}, <i32 1, i32 1, i32 1> |
| 6 | +; SHADERTEST: AMDLLPC SUCCESS |
| 7 | +; END_SHADERTEST |
| 8 | + |
| 9 | +; SPIR-V |
| 10 | +; Version: 1.0 |
| 11 | +; Generator: Khronos SPIR-V Tools Assembler; 0 |
| 12 | +; Bound: 32 |
| 13 | +; Schema: 0 |
| 14 | + OpCapability Shader |
| 15 | + OpMemoryModel Logical GLSL450 |
| 16 | + OpEntryPoint GLCompute %main "main" %gl_GlobalInvocationID |
| 17 | + OpSource GLSL 430 |
| 18 | + OpName %main "main" |
| 19 | + OpName %gl_GlobalInvocationID "gl_GlobalInvocationID" |
| 20 | + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId |
| 21 | + OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize |
| 22 | + OpDecorate %_struct_4 BufferBlock |
| 23 | + OpDecorate %5 DescriptorSet 0 |
| 24 | + OpDecorate %5 Binding 0 |
| 25 | + OpDecorate %6 DescriptorSet 0 |
| 26 | + OpDecorate %6 Binding 1 |
| 27 | + OpDecorate %_runtimearr_float ArrayStride 4 |
| 28 | + OpMemberDecorate %_struct_4 0 Offset 0 |
| 29 | + %bool = OpTypeBool |
| 30 | + %void = OpTypeVoid |
| 31 | + %10 = OpTypeFunction %void |
| 32 | + %uint = OpTypeInt 32 0 |
| 33 | + %int = OpTypeInt 32 1 |
| 34 | + %float = OpTypeFloat 32 |
| 35 | + %v3uint = OpTypeVector %uint 3 |
| 36 | + %v3float = OpTypeVector %float 3 |
| 37 | +%_ptr_Input_v3uint = OpTypePointer Input %v3uint |
| 38 | +%_ptr_Uniform_int = OpTypePointer Uniform %int |
| 39 | +%_ptr_Uniform_float = OpTypePointer Uniform %float |
| 40 | +%_runtimearr_int = OpTypeRuntimeArray %int |
| 41 | +%_runtimearr_float = OpTypeRuntimeArray %float |
| 42 | + %_struct_4 = OpTypeStruct %_runtimearr_float |
| 43 | +%_ptr_Uniform__struct_4 = OpTypePointer Uniform %_struct_4 |
| 44 | + %5 = OpVariable %_ptr_Uniform__struct_4 Uniform |
| 45 | + %6 = OpVariable %_ptr_Uniform__struct_4 Uniform |
| 46 | +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input |
| 47 | + %int_0 = OpConstant %int 0 |
| 48 | + %uint_1 = OpConstant %uint 1 |
| 49 | + %uint_1_0 = OpConstant %uint 1 |
| 50 | + %uint_1_1 = OpConstant %uint 1 |
| 51 | +%gl_WorkGroupSize = OpConstantComposite %v3uint %uint_1 %uint_1_0 %uint_1_1 |
| 52 | + %main = OpFunction %void None %10 |
| 53 | + %25 = OpLabel |
| 54 | + %26 = OpLoad %v3uint %gl_GlobalInvocationID |
| 55 | + %27 = OpCompositeExtract %uint %26 0 |
| 56 | + %28 = OpAccessChain %_ptr_Uniform_float %5 %int_0 %27 |
| 57 | + %29 = OpLoad %float %28 |
| 58 | + %30 = OpFNegate %float %29 |
| 59 | + %31 = OpAccessChain %_ptr_Uniform_float %6 %int_0 %27 |
| 60 | + OpStore %31 %30 |
| 61 | + OpReturn |
| 62 | + OpFunctionEnd |
0 commit comments