| 1 |
; SPIR-V |
| 2 |
; Version: 1.0 |
| 3 |
; Generator: Khronos Glslang Reference Front End; 1 |
| 4 |
; Bound: 30 |
| 5 |
; Schema: 0 |
| 6 |
OpCapability Shader |
| 7 |
%1 = OpExtInstImport "GLSL.std.450" |
| 8 |
OpMemoryModel Logical GLSL450 |
| 9 |
OpEntryPoint GLCompute %func "main" |
| 10 |
OpExecutionMode %func LocalSize 1 1 1 |
| 11 |
OpSource ESSL 310 |
| 12 |
OpSourceExtension "GL_GOOGLE_cpp_style_line_directive" |
| 13 |
OpSourceExtension "GL_GOOGLE_include_directive" |
| 14 |
OpMemberDecorate %input_struct 0 Offset 0 |
| 15 |
OpMemberDecorate %input_struct 1 Offset 16 |
| 16 |
OpMemberDecorate %output_struct 0 Offset 0 |
| 17 |
OpMemberDecorate %output_struct 1 Offset 16 |
| 18 |
OpDecorate %input_struct BufferBlock |
| 19 |
OpDecorate %inputs DescriptorSet 0 |
| 20 |
OpDecorate %inputs Binding 0 |
| 21 |
OpDecorate %output_struct BufferBlock |
| 22 |
OpDecorate %outputs DescriptorSet 0 |
| 23 |
OpDecorate %outputs Binding 1 |
| 24 |
|
| 25 |
%void = OpTypeVoid |
| 26 |
%main_func = OpTypeFunction %void |
| 27 |
|
| 28 |
%uint = OpTypeInt 32 0 |
| 29 |
%uvec4 = OpTypeVector %uint 4 |
| 30 |
|
| 31 |
%int = OpTypeInt 32 1 |
| 32 |
%ivec4 = OpTypeVector %int 4 |
| 33 |
|
| 34 |
%ivec4_ptr = OpTypePointer Uniform %ivec4 |
| 35 |
%uvec4_ptr = OpTypePointer Uniform %uvec4 |
| 36 |
|
| 37 |
%zero = OpConstant %int 0 |
| 38 |
%one = OpConstant %int 1 |
| 39 |
|
| 40 |
%input_struct = OpTypeStruct %ivec4 %uvec4 |
| 41 |
%input_struct_ptr = OpTypePointer Uniform %input_struct |
| 42 |
%inputs = OpVariable %input_struct_ptr Uniform |
| 43 |
%output_struct = OpTypeStruct %uvec4 %ivec4 |
| 44 |
%output_struct_ptr = OpTypePointer Uniform %output_struct |
| 45 |
%outputs = OpVariable %output_struct_ptr Uniform |
| 46 |
|
| 47 |
%func = OpFunction %void None %main_func |
| 48 |
%block = OpLabel |
| 49 |
|
| 50 |
%input1_ptr = OpAccessChain %ivec4_ptr %inputs %zero |
| 51 |
%input0_ptr = OpAccessChain %uvec4_ptr %inputs %one |
| 52 |
%input1 = OpLoad %ivec4 %input1_ptr |
| 53 |
%input0 = OpLoad %uvec4 %input0_ptr |
| 54 |
|
| 55 |
%output_ptr_uvec4 = OpAccessChain %uvec4_ptr %outputs %zero |
| 56 |
%output_ptr_ivec4 = OpAccessChain %ivec4_ptr %outputs %one |
| 57 |
|
| 58 |
; Test all variants of ShiftRightArithmetic |
| 59 |
%result_iadd_0 = OpShiftRightArithmetic %uvec4 %input0 %input1 |
| 60 |
%result_iadd_1 = OpShiftRightArithmetic %uvec4 %input1 %input0 |
| 61 |
%result_iadd_2 = OpShiftRightArithmetic %uvec4 %input0 %input0 |
| 62 |
%result_iadd_3 = OpShiftRightArithmetic %uvec4 %input1 %input1 |
| 63 |
%result_iadd_4 = OpShiftRightArithmetic %ivec4 %input0 %input0 |
| 64 |
%result_iadd_5 = OpShiftRightArithmetic %ivec4 %input1 %input1 |
| 65 |
%result_iadd_6 = OpShiftRightArithmetic %ivec4 %input0 %input1 |
| 66 |
%result_iadd_7 = OpShiftRightArithmetic %ivec4 %input1 %input0 |
| 67 |
OpStore %output_ptr_uvec4 %result_iadd_0 |
| 68 |
OpStore %output_ptr_uvec4 %result_iadd_1 |
| 69 |
OpStore %output_ptr_uvec4 %result_iadd_2 |
| 70 |
OpStore %output_ptr_uvec4 %result_iadd_3 |
| 71 |
OpStore %output_ptr_ivec4 %result_iadd_4 |
| 72 |
OpStore %output_ptr_ivec4 %result_iadd_5 |
| 73 |
OpStore %output_ptr_ivec4 %result_iadd_6 |
| 74 |
OpStore %output_ptr_ivec4 %result_iadd_7 |
| 75 |
|
| 76 |
OpReturn |
| 77 |
OpFunctionEnd |