1c18078811
Support Workgroup (threadgroup) variables. Mark if SPIRConstant is used as an array length, since it cannot be specialized. Resolve specialized array length constants. Support passing an array to MSL function. Support emitting GLSL array assignments in MSL via an array copy function. Support for memory and control barriers. Struct packing enhancements, including packing nested structs. Enhancements to replacing illegal MSL variable and function names. Add Compiler::get_entry_point_name_map() function to retrieve entry point renamings. Remove CompilerGLSL::clean_func_name() as obsolete. Fixes to types in bitcast MSL functions. Add Variant::get_id() member function. Add CompilerMSL::Options::msl_version option. Add numerous MSL compute tests.
78 lines
3.0 KiB
Plaintext
78 lines
3.0 KiB
Plaintext
; SPIR-V
|
|
; Version: 1.0
|
|
; Generator: Khronos Glslang Reference Front End; 1
|
|
; Bound: 30
|
|
; Schema: 0
|
|
OpCapability Shader
|
|
%1 = OpExtInstImport "GLSL.std.450"
|
|
OpMemoryModel Logical GLSL450
|
|
OpEntryPoint GLCompute %func "main"
|
|
OpExecutionMode %func LocalSize 1 1 1
|
|
OpSource ESSL 310
|
|
OpSourceExtension "GL_GOOGLE_cpp_style_line_directive"
|
|
OpSourceExtension "GL_GOOGLE_include_directive"
|
|
OpMemberDecorate %input_struct 0 Offset 0
|
|
OpMemberDecorate %input_struct 1 Offset 16
|
|
OpMemberDecorate %output_struct 0 Offset 0
|
|
OpMemberDecorate %output_struct 1 Offset 16
|
|
OpDecorate %input_struct BufferBlock
|
|
OpDecorate %inputs DescriptorSet 0
|
|
OpDecorate %inputs Binding 0
|
|
OpDecorate %output_struct BufferBlock
|
|
OpDecorate %outputs DescriptorSet 0
|
|
OpDecorate %outputs Binding 1
|
|
|
|
%void = OpTypeVoid
|
|
%main_func = OpTypeFunction %void
|
|
|
|
%uint = OpTypeInt 32 0
|
|
%uvec4 = OpTypeVector %uint 4
|
|
|
|
%int = OpTypeInt 32 1
|
|
%ivec4 = OpTypeVector %int 4
|
|
|
|
%ivec4_ptr = OpTypePointer Uniform %ivec4
|
|
%uvec4_ptr = OpTypePointer Uniform %uvec4
|
|
|
|
%zero = OpConstant %int 0
|
|
%one = OpConstant %int 1
|
|
|
|
%input_struct = OpTypeStruct %ivec4 %uvec4
|
|
%input_struct_ptr = OpTypePointer Uniform %input_struct
|
|
%inputs = OpVariable %input_struct_ptr Uniform
|
|
%output_struct = OpTypeStruct %uvec4 %ivec4
|
|
%output_struct_ptr = OpTypePointer Uniform %output_struct
|
|
%outputs = OpVariable %output_struct_ptr Uniform
|
|
|
|
%func = OpFunction %void None %main_func
|
|
%block = OpLabel
|
|
|
|
%input1_ptr = OpAccessChain %ivec4_ptr %inputs %zero
|
|
%input0_ptr = OpAccessChain %uvec4_ptr %inputs %one
|
|
%input1 = OpLoad %ivec4 %input1_ptr
|
|
%input0 = OpLoad %uvec4 %input0_ptr
|
|
|
|
%output_ptr_uvec4 = OpAccessChain %uvec4_ptr %outputs %zero
|
|
%output_ptr_ivec4 = OpAccessChain %ivec4_ptr %outputs %one
|
|
|
|
; Test all variants of SDiv
|
|
%result_iadd_0 = OpSDiv %uvec4 %input0 %input1
|
|
%result_iadd_1 = OpSDiv %uvec4 %input1 %input0
|
|
%result_iadd_2 = OpSDiv %uvec4 %input0 %input0
|
|
%result_iadd_3 = OpSDiv %uvec4 %input1 %input1
|
|
%result_iadd_4 = OpSDiv %ivec4 %input0 %input0
|
|
%result_iadd_5 = OpSDiv %ivec4 %input1 %input1
|
|
%result_iadd_6 = OpSDiv %ivec4 %input0 %input1
|
|
%result_iadd_7 = OpSDiv %ivec4 %input1 %input0
|
|
OpStore %output_ptr_uvec4 %result_iadd_0
|
|
OpStore %output_ptr_uvec4 %result_iadd_1
|
|
OpStore %output_ptr_uvec4 %result_iadd_2
|
|
OpStore %output_ptr_uvec4 %result_iadd_3
|
|
OpStore %output_ptr_ivec4 %result_iadd_4
|
|
OpStore %output_ptr_ivec4 %result_iadd_5
|
|
OpStore %output_ptr_ivec4 %result_iadd_6
|
|
OpStore %output_ptr_ivec4 %result_iadd_7
|
|
|
|
OpReturn
|
|
OpFunctionEnd
|