From 231b50baab51bdc47775c37b59c6bdda3c09d6e2 Mon Sep 17 00:00:00 2001 From: David Neto Date: Mon, 27 Sep 2021 20:55:53 +0000 Subject: [PATCH] Add more SPIR-V reader unit test samples Catch up to include all tests emitted by tint_unittests --dump-spirv Change-Id: Ia4d5f75782bcc62f8cfeb0615a942e95e563289d Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/65041 Auto-Submit: David Neto Kokoro: Kokoro Commit-Queue: James Price Reviewed-by: James Price --- ...HandleUsage_SampledImage_Variable_6.spvasm | 152 ++++++++++++++++++ ...HandleUsage_SampledImage_Variable_7.spvasm | 152 ++++++++++++++++++ ...HandleUsage_SampledImage_Variable_8.spvasm | 152 ++++++++++++++++++ ...HandleUsage_SampledImage_Variable_9.spvasm | 152 ++++++++++++++++++ ...arParserTest_MatrixStrideDecoration.spvasm | 29 ++++ ...rixStrideDecoration_Natural_Dropped.spvasm | 29 ++++ ...opBreak_FromContinueConstructHeader.spvasm | 53 ++++++ ...LoopBreak_FromContinueConstructTail.spvasm | 57 +++++++ ...BlockOrder_Loop_Continue_HasBreakIf.spvasm | 55 +++++++ ...kOrder_Loop_Continue_HasBreakUnless.spvasm | 55 +++++++ ...antComposite_Struct_NoDeduplication.spvasm | 51 ++++++ ...t_ConvertType_Array_NoDeduplication.spvasm | 23 +++ ...rtType_RuntimeArray_NoDeduplication.spvasm | 23 +++ ..._ConvertType_Struct_NoDeduplication.spvasm | 20 +++ ..._GlslStd450_Ldexp_Scalar_Float_Uint.spvasm | 92 +++++++++++ ...td450_Ldexp_Vector_Floatvec_Uintvec.spvasm | 92 +++++++++++ 16 files changed, 1187 insertions(+) create mode 100644 test/unittest/reader/spirv/Samples_SpvParserHandleTest_RegisterHandleUsage_SampledImage_Variable_6.spvasm create mode 100644 test/unittest/reader/spirv/Samples_SpvParserHandleTest_RegisterHandleUsage_SampledImage_Variable_7.spvasm create mode 100644 test/unittest/reader/spirv/Samples_SpvParserHandleTest_RegisterHandleUsage_SampledImage_Variable_8.spvasm create mode 100644 test/unittest/reader/spirv/Samples_SpvParserHandleTest_RegisterHandleUsage_SampledImage_Variable_9.spvasm create mode 100644 test/unittest/reader/spirv/SpvModuleScopeVarParserTest_MatrixStrideDecoration.spvasm create mode 100644 test/unittest/reader/spirv/SpvModuleScopeVarParserTest_MatrixStrideDecoration_Natural_Dropped.spvasm create mode 100644 test/unittest/reader/spirv/SpvParserCFGTest_ClassifyCFGEdges_LoopBreak_FromContinueConstructHeader.spvasm create mode 100644 test/unittest/reader/spirv/SpvParserCFGTest_ClassifyCFGEdges_LoopBreak_FromContinueConstructTail.spvasm create mode 100644 test/unittest/reader/spirv/SpvParserCFGTest_ComputeBlockOrder_Loop_Continue_HasBreakIf.spvasm create mode 100644 test/unittest/reader/spirv/SpvParserCFGTest_ComputeBlockOrder_Loop_Continue_HasBreakUnless.spvasm create mode 100644 test/unittest/reader/spirv/SpvParserTest_Composite_Construct_ConstantComposite_Struct_NoDeduplication.spvasm create mode 100644 test/unittest/reader/spirv/SpvParserTest_ConvertType_Array_NoDeduplication.spvasm create mode 100644 test/unittest/reader/spirv/SpvParserTest_ConvertType_RuntimeArray_NoDeduplication.spvasm create mode 100644 test/unittest/reader/spirv/SpvParserTest_ConvertType_Struct_NoDeduplication.spvasm create mode 100644 test/unittest/reader/spirv/SpvParserTest_GlslStd450_Ldexp_Scalar_Float_Uint.spvasm create mode 100644 test/unittest/reader/spirv/SpvParserTest_GlslStd450_Ldexp_Vector_Floatvec_Uintvec.spvasm diff --git a/test/unittest/reader/spirv/Samples_SpvParserHandleTest_RegisterHandleUsage_SampledImage_Variable_6.spvasm b/test/unittest/reader/spirv/Samples_SpvParserHandleTest_RegisterHandleUsage_SampledImage_Variable_6.spvasm new file mode 100644 index 0000000000..96ec3250d0 --- /dev/null +++ b/test/unittest/reader/spirv/Samples_SpvParserHandleTest_RegisterHandleUsage_SampledImage_Variable_6.spvasm @@ -0,0 +1,152 @@ +; Test: Samples_SpvParserHandleTest_RegisterHandleUsage_SampledImage_Variable_6.spvasm +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 132 +; Schema: 0 +OpCapability Shader +OpCapability Sampled1D +OpCapability Image1D +OpCapability StorageImageExtendedFormats +OpCapability ImageQuery +OpMemoryModel Logical Simple +OpEntryPoint Fragment %1 "main" +OpExecutionMode %1 OriginUpperLeft +OpDecorate %10 DescriptorSet 0 +OpDecorate %10 Binding 0 +OpDecorate %20 DescriptorSet 0 +OpDecorate %20 Binding 1 +%void = OpTypeVoid +%3 = OpTypeFunction %void +%float = OpTypeFloat 32 +%uint = OpTypeInt 32 0 +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%int_1 = OpConstant %int 1 +%int_2 = OpConstant %int 2 +%int_3 = OpConstant %int 3 +%int_4 = OpConstant %int 4 +%uint_0 = OpConstant %uint 0 +%uint_1 = OpConstant %uint 1 +%uint_2 = OpConstant %uint 2 +%uint_3 = OpConstant %uint 3 +%uint_4 = OpConstant %uint 4 +%uint_100 = OpConstant %uint 100 +%v2int = OpTypeVector %int 2 +%v3int = OpTypeVector %int 3 +%v4int = OpTypeVector %int 4 +%v2uint = OpTypeVector %uint 2 +%v3uint = OpTypeVector %uint 3 +%v4uint = OpTypeVector %uint 4 +%v2float = OpTypeVector %float 2 +%v3float = OpTypeVector %float 3 +%v4float = OpTypeVector %float 4 +%29 = OpConstantNull %float +%float_0 = OpConstant %float 0 +%float_1 = OpConstant %float 1 +%float_2 = OpConstant %float 2 +%float_3 = OpConstant %float 3 +%float_4 = OpConstant %float 4 +%float_7 = OpConstant %float 7 +%36 = OpConstantNull %v2float +%37 = OpConstantNull %v3float +%38 = OpConstantNull %v4float +%39 = OpConstantComposite %v2int %int_1 %int_2 +%40 = OpConstantComposite %v3int %int_1 %int_2 %int_3 +%41 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4 +%42 = OpConstantComposite %v2uint %uint_1 %uint_2 +%43 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3 +%44 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4 +%45 = OpConstantComposite %v2float %float_1 %float_2 +%46 = OpConstantComposite %v2float %float_2 %float_1 +%47 = OpConstantComposite %v3float %float_1 %float_2 %float_3 +%48 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4 +%float_0_200000003 = OpConstant %float 0.200000003 +%50 = OpTypeSampler +%51 = OpTypeImage %float 1D 0 0 0 1 Unknown +%52 = OpTypeImage %float 2D 0 0 0 1 Unknown +%53 = OpTypeImage %float 2D 0 0 1 1 Unknown +%54 = OpTypeImage %float 2D 0 1 0 1 Unknown +%55 = OpTypeImage %float 2D 0 1 1 1 Unknown +%56 = OpTypeImage %float 3D 0 0 0 1 Unknown +%57 = OpTypeImage %float Cube 0 0 0 1 Unknown +%58 = OpTypeImage %float Cube 0 1 0 1 Unknown +%59 = OpTypeImage %float 1D 0 0 0 2 Rg32f +%60 = OpTypeImage %float 2D 0 0 0 2 Rg32f +%61 = OpTypeImage %float 2D 0 1 0 2 Rg32f +%62 = OpTypeImage %float 3D 0 0 0 2 Rg32f +%63 = OpTypeImage %uint 1D 0 0 0 1 Unknown +%64 = OpTypeImage %uint 2D 0 0 0 1 Unknown +%65 = OpTypeImage %uint 2D 0 0 1 1 Unknown +%66 = OpTypeImage %uint 2D 0 1 0 1 Unknown +%67 = OpTypeImage %uint 2D 0 1 1 1 Unknown +%68 = OpTypeImage %uint 3D 0 0 0 1 Unknown +%69 = OpTypeImage %uint Cube 0 0 0 1 Unknown +%70 = OpTypeImage %uint Cube 0 1 0 1 Unknown +%71 = OpTypeImage %uint 1D 0 0 0 2 Rg32ui +%72 = OpTypeImage %uint 2D 0 0 0 2 Rg32ui +%73 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui +%74 = OpTypeImage %uint 3D 0 0 0 2 Rg32ui +%75 = OpTypeImage %int 1D 0 0 0 1 Unknown +%76 = OpTypeImage %int 2D 0 0 0 1 Unknown +%77 = OpTypeImage %int 2D 0 0 1 1 Unknown +%78 = OpTypeImage %int 2D 0 1 0 1 Unknown +%79 = OpTypeImage %int 2D 0 1 1 1 Unknown +%80 = OpTypeImage %int 3D 0 0 0 1 Unknown +%81 = OpTypeImage %int Cube 0 0 0 1 Unknown +%82 = OpTypeImage %int Cube 0 1 0 1 Unknown +%83 = OpTypeImage %int 1D 0 0 0 2 Rg32i +%84 = OpTypeImage %int 2D 0 0 0 2 Rg32i +%85 = OpTypeImage %int 2D 0 1 0 2 Rg32i +%86 = OpTypeImage %int 3D 0 0 0 2 Rg32i +%_ptr_UniformConstant_50 = OpTypePointer UniformConstant %50 +%_ptr_UniformConstant_51 = OpTypePointer UniformConstant %51 +%_ptr_UniformConstant_52 = OpTypePointer UniformConstant %52 +%_ptr_UniformConstant_53 = OpTypePointer UniformConstant %53 +%_ptr_UniformConstant_54 = OpTypePointer UniformConstant %54 +%_ptr_UniformConstant_55 = OpTypePointer UniformConstant %55 +%_ptr_UniformConstant_56 = OpTypePointer UniformConstant %56 +%_ptr_UniformConstant_57 = OpTypePointer UniformConstant %57 +%_ptr_UniformConstant_58 = OpTypePointer UniformConstant %58 +%_ptr_UniformConstant_59 = OpTypePointer UniformConstant %59 +%_ptr_UniformConstant_60 = OpTypePointer UniformConstant %60 +%_ptr_UniformConstant_61 = OpTypePointer UniformConstant %61 +%_ptr_UniformConstant_62 = OpTypePointer UniformConstant %62 +%_ptr_UniformConstant_63 = OpTypePointer UniformConstant %63 +%_ptr_UniformConstant_64 = OpTypePointer UniformConstant %64 +%_ptr_UniformConstant_65 = OpTypePointer UniformConstant %65 +%_ptr_UniformConstant_66 = OpTypePointer UniformConstant %66 +%_ptr_UniformConstant_67 = OpTypePointer UniformConstant %67 +%_ptr_UniformConstant_68 = OpTypePointer UniformConstant %68 +%_ptr_UniformConstant_69 = OpTypePointer UniformConstant %69 +%_ptr_UniformConstant_70 = OpTypePointer UniformConstant %70 +%_ptr_UniformConstant_71 = OpTypePointer UniformConstant %71 +%_ptr_UniformConstant_72 = OpTypePointer UniformConstant %72 +%_ptr_UniformConstant_73 = OpTypePointer UniformConstant %73 +%_ptr_UniformConstant_74 = OpTypePointer UniformConstant %74 +%_ptr_UniformConstant_75 = OpTypePointer UniformConstant %75 +%_ptr_UniformConstant_76 = OpTypePointer UniformConstant %76 +%_ptr_UniformConstant_77 = OpTypePointer UniformConstant %77 +%_ptr_UniformConstant_78 = OpTypePointer UniformConstant %78 +%_ptr_UniformConstant_79 = OpTypePointer UniformConstant %79 +%_ptr_UniformConstant_80 = OpTypePointer UniformConstant %80 +%_ptr_UniformConstant_81 = OpTypePointer UniformConstant %81 +%_ptr_UniformConstant_82 = OpTypePointer UniformConstant %82 +%_ptr_UniformConstant_83 = OpTypePointer UniformConstant %83 +%_ptr_UniformConstant_84 = OpTypePointer UniformConstant %84 +%_ptr_UniformConstant_85 = OpTypePointer UniformConstant %85 +%_ptr_UniformConstant_86 = OpTypePointer UniformConstant %86 +%124 = OpTypeSampledImage %52 +%125 = OpConstantNull %v2float +%126 = OpConstantNull %v3float +%10 = OpVariable %_ptr_UniformConstant_50 UniformConstant +%20 = OpVariable %_ptr_UniformConstant_52 UniformConstant +%1 = OpFunction %void None %3 +%127 = OpLabel +%128 = OpLoad %50 %10 +%129 = OpLoad %52 %20 +%130 = OpSampledImage %124 %129 %128 +%131 = OpImageSampleProjImplicitLod %v4float %130 %126 +OpReturn +OpFunctionEnd + diff --git a/test/unittest/reader/spirv/Samples_SpvParserHandleTest_RegisterHandleUsage_SampledImage_Variable_7.spvasm b/test/unittest/reader/spirv/Samples_SpvParserHandleTest_RegisterHandleUsage_SampledImage_Variable_7.spvasm new file mode 100644 index 0000000000..0bfff9ed20 --- /dev/null +++ b/test/unittest/reader/spirv/Samples_SpvParserHandleTest_RegisterHandleUsage_SampledImage_Variable_7.spvasm @@ -0,0 +1,152 @@ +; Test: Samples_SpvParserHandleTest_RegisterHandleUsage_SampledImage_Variable_7.spvasm +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 132 +; Schema: 0 +OpCapability Shader +OpCapability Sampled1D +OpCapability Image1D +OpCapability StorageImageExtendedFormats +OpCapability ImageQuery +OpMemoryModel Logical Simple +OpEntryPoint Fragment %1 "main" +OpExecutionMode %1 OriginUpperLeft +OpDecorate %10 DescriptorSet 0 +OpDecorate %10 Binding 0 +OpDecorate %20 DescriptorSet 0 +OpDecorate %20 Binding 1 +%void = OpTypeVoid +%3 = OpTypeFunction %void +%float = OpTypeFloat 32 +%uint = OpTypeInt 32 0 +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%int_1 = OpConstant %int 1 +%int_2 = OpConstant %int 2 +%int_3 = OpConstant %int 3 +%int_4 = OpConstant %int 4 +%uint_0 = OpConstant %uint 0 +%uint_1 = OpConstant %uint 1 +%uint_2 = OpConstant %uint 2 +%uint_3 = OpConstant %uint 3 +%uint_4 = OpConstant %uint 4 +%uint_100 = OpConstant %uint 100 +%v2int = OpTypeVector %int 2 +%v3int = OpTypeVector %int 3 +%v4int = OpTypeVector %int 4 +%v2uint = OpTypeVector %uint 2 +%v3uint = OpTypeVector %uint 3 +%v4uint = OpTypeVector %uint 4 +%v2float = OpTypeVector %float 2 +%v3float = OpTypeVector %float 3 +%v4float = OpTypeVector %float 4 +%29 = OpConstantNull %float +%float_0 = OpConstant %float 0 +%float_1 = OpConstant %float 1 +%float_2 = OpConstant %float 2 +%float_3 = OpConstant %float 3 +%float_4 = OpConstant %float 4 +%float_7 = OpConstant %float 7 +%36 = OpConstantNull %v2float +%37 = OpConstantNull %v3float +%38 = OpConstantNull %v4float +%39 = OpConstantComposite %v2int %int_1 %int_2 +%40 = OpConstantComposite %v3int %int_1 %int_2 %int_3 +%41 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4 +%42 = OpConstantComposite %v2uint %uint_1 %uint_2 +%43 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3 +%44 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4 +%45 = OpConstantComposite %v2float %float_1 %float_2 +%46 = OpConstantComposite %v2float %float_2 %float_1 +%47 = OpConstantComposite %v3float %float_1 %float_2 %float_3 +%48 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4 +%float_0_200000003 = OpConstant %float 0.200000003 +%50 = OpTypeSampler +%51 = OpTypeImage %float 1D 0 0 0 1 Unknown +%52 = OpTypeImage %float 2D 0 0 0 1 Unknown +%53 = OpTypeImage %float 2D 0 0 1 1 Unknown +%54 = OpTypeImage %float 2D 0 1 0 1 Unknown +%55 = OpTypeImage %float 2D 0 1 1 1 Unknown +%56 = OpTypeImage %float 3D 0 0 0 1 Unknown +%57 = OpTypeImage %float Cube 0 0 0 1 Unknown +%58 = OpTypeImage %float Cube 0 1 0 1 Unknown +%59 = OpTypeImage %float 1D 0 0 0 2 Rg32f +%60 = OpTypeImage %float 2D 0 0 0 2 Rg32f +%61 = OpTypeImage %float 2D 0 1 0 2 Rg32f +%62 = OpTypeImage %float 3D 0 0 0 2 Rg32f +%63 = OpTypeImage %uint 1D 0 0 0 1 Unknown +%64 = OpTypeImage %uint 2D 0 0 0 1 Unknown +%65 = OpTypeImage %uint 2D 0 0 1 1 Unknown +%66 = OpTypeImage %uint 2D 0 1 0 1 Unknown +%67 = OpTypeImage %uint 2D 0 1 1 1 Unknown +%68 = OpTypeImage %uint 3D 0 0 0 1 Unknown +%69 = OpTypeImage %uint Cube 0 0 0 1 Unknown +%70 = OpTypeImage %uint Cube 0 1 0 1 Unknown +%71 = OpTypeImage %uint 1D 0 0 0 2 Rg32ui +%72 = OpTypeImage %uint 2D 0 0 0 2 Rg32ui +%73 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui +%74 = OpTypeImage %uint 3D 0 0 0 2 Rg32ui +%75 = OpTypeImage %int 1D 0 0 0 1 Unknown +%76 = OpTypeImage %int 2D 0 0 0 1 Unknown +%77 = OpTypeImage %int 2D 0 0 1 1 Unknown +%78 = OpTypeImage %int 2D 0 1 0 1 Unknown +%79 = OpTypeImage %int 2D 0 1 1 1 Unknown +%80 = OpTypeImage %int 3D 0 0 0 1 Unknown +%81 = OpTypeImage %int Cube 0 0 0 1 Unknown +%82 = OpTypeImage %int Cube 0 1 0 1 Unknown +%83 = OpTypeImage %int 1D 0 0 0 2 Rg32i +%84 = OpTypeImage %int 2D 0 0 0 2 Rg32i +%85 = OpTypeImage %int 2D 0 1 0 2 Rg32i +%86 = OpTypeImage %int 3D 0 0 0 2 Rg32i +%_ptr_UniformConstant_50 = OpTypePointer UniformConstant %50 +%_ptr_UniformConstant_51 = OpTypePointer UniformConstant %51 +%_ptr_UniformConstant_52 = OpTypePointer UniformConstant %52 +%_ptr_UniformConstant_53 = OpTypePointer UniformConstant %53 +%_ptr_UniformConstant_54 = OpTypePointer UniformConstant %54 +%_ptr_UniformConstant_55 = OpTypePointer UniformConstant %55 +%_ptr_UniformConstant_56 = OpTypePointer UniformConstant %56 +%_ptr_UniformConstant_57 = OpTypePointer UniformConstant %57 +%_ptr_UniformConstant_58 = OpTypePointer UniformConstant %58 +%_ptr_UniformConstant_59 = OpTypePointer UniformConstant %59 +%_ptr_UniformConstant_60 = OpTypePointer UniformConstant %60 +%_ptr_UniformConstant_61 = OpTypePointer UniformConstant %61 +%_ptr_UniformConstant_62 = OpTypePointer UniformConstant %62 +%_ptr_UniformConstant_63 = OpTypePointer UniformConstant %63 +%_ptr_UniformConstant_64 = OpTypePointer UniformConstant %64 +%_ptr_UniformConstant_65 = OpTypePointer UniformConstant %65 +%_ptr_UniformConstant_66 = OpTypePointer UniformConstant %66 +%_ptr_UniformConstant_67 = OpTypePointer UniformConstant %67 +%_ptr_UniformConstant_68 = OpTypePointer UniformConstant %68 +%_ptr_UniformConstant_69 = OpTypePointer UniformConstant %69 +%_ptr_UniformConstant_70 = OpTypePointer UniformConstant %70 +%_ptr_UniformConstant_71 = OpTypePointer UniformConstant %71 +%_ptr_UniformConstant_72 = OpTypePointer UniformConstant %72 +%_ptr_UniformConstant_73 = OpTypePointer UniformConstant %73 +%_ptr_UniformConstant_74 = OpTypePointer UniformConstant %74 +%_ptr_UniformConstant_75 = OpTypePointer UniformConstant %75 +%_ptr_UniformConstant_76 = OpTypePointer UniformConstant %76 +%_ptr_UniformConstant_77 = OpTypePointer UniformConstant %77 +%_ptr_UniformConstant_78 = OpTypePointer UniformConstant %78 +%_ptr_UniformConstant_79 = OpTypePointer UniformConstant %79 +%_ptr_UniformConstant_80 = OpTypePointer UniformConstant %80 +%_ptr_UniformConstant_81 = OpTypePointer UniformConstant %81 +%_ptr_UniformConstant_82 = OpTypePointer UniformConstant %82 +%_ptr_UniformConstant_83 = OpTypePointer UniformConstant %83 +%_ptr_UniformConstant_84 = OpTypePointer UniformConstant %84 +%_ptr_UniformConstant_85 = OpTypePointer UniformConstant %85 +%_ptr_UniformConstant_86 = OpTypePointer UniformConstant %86 +%124 = OpTypeSampledImage %52 +%125 = OpConstantNull %v2float +%126 = OpConstantNull %v3float +%10 = OpVariable %_ptr_UniformConstant_50 UniformConstant +%20 = OpVariable %_ptr_UniformConstant_52 UniformConstant +%1 = OpFunction %void None %3 +%127 = OpLabel +%128 = OpLoad %50 %10 +%129 = OpLoad %52 %20 +%130 = OpSampledImage %124 %129 %128 +%131 = OpImageSampleProjExplicitLod %v4float %130 %126 Lod %29 +OpReturn +OpFunctionEnd + diff --git a/test/unittest/reader/spirv/Samples_SpvParserHandleTest_RegisterHandleUsage_SampledImage_Variable_8.spvasm b/test/unittest/reader/spirv/Samples_SpvParserHandleTest_RegisterHandleUsage_SampledImage_Variable_8.spvasm new file mode 100644 index 0000000000..90ad7729c9 --- /dev/null +++ b/test/unittest/reader/spirv/Samples_SpvParserHandleTest_RegisterHandleUsage_SampledImage_Variable_8.spvasm @@ -0,0 +1,152 @@ +; Test: Samples_SpvParserHandleTest_RegisterHandleUsage_SampledImage_Variable_8.spvasm +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 132 +; Schema: 0 +OpCapability Shader +OpCapability Sampled1D +OpCapability Image1D +OpCapability StorageImageExtendedFormats +OpCapability ImageQuery +OpMemoryModel Logical Simple +OpEntryPoint Fragment %1 "main" +OpExecutionMode %1 OriginUpperLeft +OpDecorate %10 DescriptorSet 0 +OpDecorate %10 Binding 0 +OpDecorate %20 DescriptorSet 0 +OpDecorate %20 Binding 1 +%void = OpTypeVoid +%3 = OpTypeFunction %void +%float = OpTypeFloat 32 +%uint = OpTypeInt 32 0 +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%int_1 = OpConstant %int 1 +%int_2 = OpConstant %int 2 +%int_3 = OpConstant %int 3 +%int_4 = OpConstant %int 4 +%uint_0 = OpConstant %uint 0 +%uint_1 = OpConstant %uint 1 +%uint_2 = OpConstant %uint 2 +%uint_3 = OpConstant %uint 3 +%uint_4 = OpConstant %uint 4 +%uint_100 = OpConstant %uint 100 +%v2int = OpTypeVector %int 2 +%v3int = OpTypeVector %int 3 +%v4int = OpTypeVector %int 4 +%v2uint = OpTypeVector %uint 2 +%v3uint = OpTypeVector %uint 3 +%v4uint = OpTypeVector %uint 4 +%v2float = OpTypeVector %float 2 +%v3float = OpTypeVector %float 3 +%v4float = OpTypeVector %float 4 +%29 = OpConstantNull %float +%float_0 = OpConstant %float 0 +%float_1 = OpConstant %float 1 +%float_2 = OpConstant %float 2 +%float_3 = OpConstant %float 3 +%float_4 = OpConstant %float 4 +%float_7 = OpConstant %float 7 +%36 = OpConstantNull %v2float +%37 = OpConstantNull %v3float +%38 = OpConstantNull %v4float +%39 = OpConstantComposite %v2int %int_1 %int_2 +%40 = OpConstantComposite %v3int %int_1 %int_2 %int_3 +%41 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4 +%42 = OpConstantComposite %v2uint %uint_1 %uint_2 +%43 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3 +%44 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4 +%45 = OpConstantComposite %v2float %float_1 %float_2 +%46 = OpConstantComposite %v2float %float_2 %float_1 +%47 = OpConstantComposite %v3float %float_1 %float_2 %float_3 +%48 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4 +%float_0_200000003 = OpConstant %float 0.200000003 +%50 = OpTypeSampler +%51 = OpTypeImage %float 1D 0 0 0 1 Unknown +%52 = OpTypeImage %float 2D 0 0 0 1 Unknown +%53 = OpTypeImage %float 2D 0 0 1 1 Unknown +%54 = OpTypeImage %float 2D 0 1 0 1 Unknown +%55 = OpTypeImage %float 2D 0 1 1 1 Unknown +%56 = OpTypeImage %float 3D 0 0 0 1 Unknown +%57 = OpTypeImage %float Cube 0 0 0 1 Unknown +%58 = OpTypeImage %float Cube 0 1 0 1 Unknown +%59 = OpTypeImage %float 1D 0 0 0 2 Rg32f +%60 = OpTypeImage %float 2D 0 0 0 2 Rg32f +%61 = OpTypeImage %float 2D 0 1 0 2 Rg32f +%62 = OpTypeImage %float 3D 0 0 0 2 Rg32f +%63 = OpTypeImage %uint 1D 0 0 0 1 Unknown +%64 = OpTypeImage %uint 2D 0 0 0 1 Unknown +%65 = OpTypeImage %uint 2D 0 0 1 1 Unknown +%66 = OpTypeImage %uint 2D 0 1 0 1 Unknown +%67 = OpTypeImage %uint 2D 0 1 1 1 Unknown +%68 = OpTypeImage %uint 3D 0 0 0 1 Unknown +%69 = OpTypeImage %uint Cube 0 0 0 1 Unknown +%70 = OpTypeImage %uint Cube 0 1 0 1 Unknown +%71 = OpTypeImage %uint 1D 0 0 0 2 Rg32ui +%72 = OpTypeImage %uint 2D 0 0 0 2 Rg32ui +%73 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui +%74 = OpTypeImage %uint 3D 0 0 0 2 Rg32ui +%75 = OpTypeImage %int 1D 0 0 0 1 Unknown +%76 = OpTypeImage %int 2D 0 0 0 1 Unknown +%77 = OpTypeImage %int 2D 0 0 1 1 Unknown +%78 = OpTypeImage %int 2D 0 1 0 1 Unknown +%79 = OpTypeImage %int 2D 0 1 1 1 Unknown +%80 = OpTypeImage %int 3D 0 0 0 1 Unknown +%81 = OpTypeImage %int Cube 0 0 0 1 Unknown +%82 = OpTypeImage %int Cube 0 1 0 1 Unknown +%83 = OpTypeImage %int 1D 0 0 0 2 Rg32i +%84 = OpTypeImage %int 2D 0 0 0 2 Rg32i +%85 = OpTypeImage %int 2D 0 1 0 2 Rg32i +%86 = OpTypeImage %int 3D 0 0 0 2 Rg32i +%_ptr_UniformConstant_50 = OpTypePointer UniformConstant %50 +%_ptr_UniformConstant_51 = OpTypePointer UniformConstant %51 +%_ptr_UniformConstant_52 = OpTypePointer UniformConstant %52 +%_ptr_UniformConstant_53 = OpTypePointer UniformConstant %53 +%_ptr_UniformConstant_54 = OpTypePointer UniformConstant %54 +%_ptr_UniformConstant_55 = OpTypePointer UniformConstant %55 +%_ptr_UniformConstant_56 = OpTypePointer UniformConstant %56 +%_ptr_UniformConstant_57 = OpTypePointer UniformConstant %57 +%_ptr_UniformConstant_58 = OpTypePointer UniformConstant %58 +%_ptr_UniformConstant_59 = OpTypePointer UniformConstant %59 +%_ptr_UniformConstant_60 = OpTypePointer UniformConstant %60 +%_ptr_UniformConstant_61 = OpTypePointer UniformConstant %61 +%_ptr_UniformConstant_62 = OpTypePointer UniformConstant %62 +%_ptr_UniformConstant_63 = OpTypePointer UniformConstant %63 +%_ptr_UniformConstant_64 = OpTypePointer UniformConstant %64 +%_ptr_UniformConstant_65 = OpTypePointer UniformConstant %65 +%_ptr_UniformConstant_66 = OpTypePointer UniformConstant %66 +%_ptr_UniformConstant_67 = OpTypePointer UniformConstant %67 +%_ptr_UniformConstant_68 = OpTypePointer UniformConstant %68 +%_ptr_UniformConstant_69 = OpTypePointer UniformConstant %69 +%_ptr_UniformConstant_70 = OpTypePointer UniformConstant %70 +%_ptr_UniformConstant_71 = OpTypePointer UniformConstant %71 +%_ptr_UniformConstant_72 = OpTypePointer UniformConstant %72 +%_ptr_UniformConstant_73 = OpTypePointer UniformConstant %73 +%_ptr_UniformConstant_74 = OpTypePointer UniformConstant %74 +%_ptr_UniformConstant_75 = OpTypePointer UniformConstant %75 +%_ptr_UniformConstant_76 = OpTypePointer UniformConstant %76 +%_ptr_UniformConstant_77 = OpTypePointer UniformConstant %77 +%_ptr_UniformConstant_78 = OpTypePointer UniformConstant %78 +%_ptr_UniformConstant_79 = OpTypePointer UniformConstant %79 +%_ptr_UniformConstant_80 = OpTypePointer UniformConstant %80 +%_ptr_UniformConstant_81 = OpTypePointer UniformConstant %81 +%_ptr_UniformConstant_82 = OpTypePointer UniformConstant %82 +%_ptr_UniformConstant_83 = OpTypePointer UniformConstant %83 +%_ptr_UniformConstant_84 = OpTypePointer UniformConstant %84 +%_ptr_UniformConstant_85 = OpTypePointer UniformConstant %85 +%_ptr_UniformConstant_86 = OpTypePointer UniformConstant %86 +%124 = OpTypeSampledImage %52 +%125 = OpConstantNull %v2float +%126 = OpConstantNull %v3float +%10 = OpVariable %_ptr_UniformConstant_50 UniformConstant +%20 = OpVariable %_ptr_UniformConstant_52 UniformConstant +%1 = OpFunction %void None %3 +%127 = OpLabel +%128 = OpLoad %50 %10 +%129 = OpLoad %52 %20 +%130 = OpSampledImage %124 %129 %128 +%131 = OpImageSampleProjDrefImplicitLod %float %130 %126 %float_0_200000003 +OpReturn +OpFunctionEnd + diff --git a/test/unittest/reader/spirv/Samples_SpvParserHandleTest_RegisterHandleUsage_SampledImage_Variable_9.spvasm b/test/unittest/reader/spirv/Samples_SpvParserHandleTest_RegisterHandleUsage_SampledImage_Variable_9.spvasm new file mode 100644 index 0000000000..5e594ceb80 --- /dev/null +++ b/test/unittest/reader/spirv/Samples_SpvParserHandleTest_RegisterHandleUsage_SampledImage_Variable_9.spvasm @@ -0,0 +1,152 @@ +; Test: Samples_SpvParserHandleTest_RegisterHandleUsage_SampledImage_Variable_9.spvasm +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 132 +; Schema: 0 +OpCapability Shader +OpCapability Sampled1D +OpCapability Image1D +OpCapability StorageImageExtendedFormats +OpCapability ImageQuery +OpMemoryModel Logical Simple +OpEntryPoint Fragment %1 "main" +OpExecutionMode %1 OriginUpperLeft +OpDecorate %10 DescriptorSet 0 +OpDecorate %10 Binding 0 +OpDecorate %20 DescriptorSet 0 +OpDecorate %20 Binding 1 +%void = OpTypeVoid +%3 = OpTypeFunction %void +%float = OpTypeFloat 32 +%uint = OpTypeInt 32 0 +%int = OpTypeInt 32 1 +%int_0 = OpConstant %int 0 +%int_1 = OpConstant %int 1 +%int_2 = OpConstant %int 2 +%int_3 = OpConstant %int 3 +%int_4 = OpConstant %int 4 +%uint_0 = OpConstant %uint 0 +%uint_1 = OpConstant %uint 1 +%uint_2 = OpConstant %uint 2 +%uint_3 = OpConstant %uint 3 +%uint_4 = OpConstant %uint 4 +%uint_100 = OpConstant %uint 100 +%v2int = OpTypeVector %int 2 +%v3int = OpTypeVector %int 3 +%v4int = OpTypeVector %int 4 +%v2uint = OpTypeVector %uint 2 +%v3uint = OpTypeVector %uint 3 +%v4uint = OpTypeVector %uint 4 +%v2float = OpTypeVector %float 2 +%v3float = OpTypeVector %float 3 +%v4float = OpTypeVector %float 4 +%29 = OpConstantNull %float +%float_0 = OpConstant %float 0 +%float_1 = OpConstant %float 1 +%float_2 = OpConstant %float 2 +%float_3 = OpConstant %float 3 +%float_4 = OpConstant %float 4 +%float_7 = OpConstant %float 7 +%36 = OpConstantNull %v2float +%37 = OpConstantNull %v3float +%38 = OpConstantNull %v4float +%39 = OpConstantComposite %v2int %int_1 %int_2 +%40 = OpConstantComposite %v3int %int_1 %int_2 %int_3 +%41 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4 +%42 = OpConstantComposite %v2uint %uint_1 %uint_2 +%43 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3 +%44 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4 +%45 = OpConstantComposite %v2float %float_1 %float_2 +%46 = OpConstantComposite %v2float %float_2 %float_1 +%47 = OpConstantComposite %v3float %float_1 %float_2 %float_3 +%48 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4 +%float_0_200000003 = OpConstant %float 0.200000003 +%50 = OpTypeSampler +%51 = OpTypeImage %float 1D 0 0 0 1 Unknown +%52 = OpTypeImage %float 2D 0 0 0 1 Unknown +%53 = OpTypeImage %float 2D 0 0 1 1 Unknown +%54 = OpTypeImage %float 2D 0 1 0 1 Unknown +%55 = OpTypeImage %float 2D 0 1 1 1 Unknown +%56 = OpTypeImage %float 3D 0 0 0 1 Unknown +%57 = OpTypeImage %float Cube 0 0 0 1 Unknown +%58 = OpTypeImage %float Cube 0 1 0 1 Unknown +%59 = OpTypeImage %float 1D 0 0 0 2 Rg32f +%60 = OpTypeImage %float 2D 0 0 0 2 Rg32f +%61 = OpTypeImage %float 2D 0 1 0 2 Rg32f +%62 = OpTypeImage %float 3D 0 0 0 2 Rg32f +%63 = OpTypeImage %uint 1D 0 0 0 1 Unknown +%64 = OpTypeImage %uint 2D 0 0 0 1 Unknown +%65 = OpTypeImage %uint 2D 0 0 1 1 Unknown +%66 = OpTypeImage %uint 2D 0 1 0 1 Unknown +%67 = OpTypeImage %uint 2D 0 1 1 1 Unknown +%68 = OpTypeImage %uint 3D 0 0 0 1 Unknown +%69 = OpTypeImage %uint Cube 0 0 0 1 Unknown +%70 = OpTypeImage %uint Cube 0 1 0 1 Unknown +%71 = OpTypeImage %uint 1D 0 0 0 2 Rg32ui +%72 = OpTypeImage %uint 2D 0 0 0 2 Rg32ui +%73 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui +%74 = OpTypeImage %uint 3D 0 0 0 2 Rg32ui +%75 = OpTypeImage %int 1D 0 0 0 1 Unknown +%76 = OpTypeImage %int 2D 0 0 0 1 Unknown +%77 = OpTypeImage %int 2D 0 0 1 1 Unknown +%78 = OpTypeImage %int 2D 0 1 0 1 Unknown +%79 = OpTypeImage %int 2D 0 1 1 1 Unknown +%80 = OpTypeImage %int 3D 0 0 0 1 Unknown +%81 = OpTypeImage %int Cube 0 0 0 1 Unknown +%82 = OpTypeImage %int Cube 0 1 0 1 Unknown +%83 = OpTypeImage %int 1D 0 0 0 2 Rg32i +%84 = OpTypeImage %int 2D 0 0 0 2 Rg32i +%85 = OpTypeImage %int 2D 0 1 0 2 Rg32i +%86 = OpTypeImage %int 3D 0 0 0 2 Rg32i +%_ptr_UniformConstant_50 = OpTypePointer UniformConstant %50 +%_ptr_UniformConstant_51 = OpTypePointer UniformConstant %51 +%_ptr_UniformConstant_52 = OpTypePointer UniformConstant %52 +%_ptr_UniformConstant_53 = OpTypePointer UniformConstant %53 +%_ptr_UniformConstant_54 = OpTypePointer UniformConstant %54 +%_ptr_UniformConstant_55 = OpTypePointer UniformConstant %55 +%_ptr_UniformConstant_56 = OpTypePointer UniformConstant %56 +%_ptr_UniformConstant_57 = OpTypePointer UniformConstant %57 +%_ptr_UniformConstant_58 = OpTypePointer UniformConstant %58 +%_ptr_UniformConstant_59 = OpTypePointer UniformConstant %59 +%_ptr_UniformConstant_60 = OpTypePointer UniformConstant %60 +%_ptr_UniformConstant_61 = OpTypePointer UniformConstant %61 +%_ptr_UniformConstant_62 = OpTypePointer UniformConstant %62 +%_ptr_UniformConstant_63 = OpTypePointer UniformConstant %63 +%_ptr_UniformConstant_64 = OpTypePointer UniformConstant %64 +%_ptr_UniformConstant_65 = OpTypePointer UniformConstant %65 +%_ptr_UniformConstant_66 = OpTypePointer UniformConstant %66 +%_ptr_UniformConstant_67 = OpTypePointer UniformConstant %67 +%_ptr_UniformConstant_68 = OpTypePointer UniformConstant %68 +%_ptr_UniformConstant_69 = OpTypePointer UniformConstant %69 +%_ptr_UniformConstant_70 = OpTypePointer UniformConstant %70 +%_ptr_UniformConstant_71 = OpTypePointer UniformConstant %71 +%_ptr_UniformConstant_72 = OpTypePointer UniformConstant %72 +%_ptr_UniformConstant_73 = OpTypePointer UniformConstant %73 +%_ptr_UniformConstant_74 = OpTypePointer UniformConstant %74 +%_ptr_UniformConstant_75 = OpTypePointer UniformConstant %75 +%_ptr_UniformConstant_76 = OpTypePointer UniformConstant %76 +%_ptr_UniformConstant_77 = OpTypePointer UniformConstant %77 +%_ptr_UniformConstant_78 = OpTypePointer UniformConstant %78 +%_ptr_UniformConstant_79 = OpTypePointer UniformConstant %79 +%_ptr_UniformConstant_80 = OpTypePointer UniformConstant %80 +%_ptr_UniformConstant_81 = OpTypePointer UniformConstant %81 +%_ptr_UniformConstant_82 = OpTypePointer UniformConstant %82 +%_ptr_UniformConstant_83 = OpTypePointer UniformConstant %83 +%_ptr_UniformConstant_84 = OpTypePointer UniformConstant %84 +%_ptr_UniformConstant_85 = OpTypePointer UniformConstant %85 +%_ptr_UniformConstant_86 = OpTypePointer UniformConstant %86 +%124 = OpTypeSampledImage %52 +%125 = OpConstantNull %v2float +%126 = OpConstantNull %v3float +%10 = OpVariable %_ptr_UniformConstant_50 UniformConstant +%20 = OpVariable %_ptr_UniformConstant_52 UniformConstant +%1 = OpFunction %void None %3 +%127 = OpLabel +%128 = OpLoad %50 %10 +%129 = OpLoad %52 %20 +%130 = OpSampledImage %124 %129 %128 +%131 = OpImageSampleProjDrefExplicitLod %float %130 %126 %float_0_200000003 Lod %29 +OpReturn +OpFunctionEnd + diff --git a/test/unittest/reader/spirv/SpvModuleScopeVarParserTest_MatrixStrideDecoration.spvasm b/test/unittest/reader/spirv/SpvModuleScopeVarParserTest_MatrixStrideDecoration.spvasm new file mode 100644 index 0000000000..9050c5d15d --- /dev/null +++ b/test/unittest/reader/spirv/SpvModuleScopeVarParserTest_MatrixStrideDecoration.spvasm @@ -0,0 +1,29 @@ +; Test: SpvModuleScopeVarParserTest_MatrixStrideDecoration.spvasm +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 11 +; Schema: 0 +OpCapability Shader +OpMemoryModel Logical Simple +OpEntryPoint Fragment %1 "main" +OpExecutionMode %1 OriginUpperLeft +OpName %myvar "myvar" +OpDecorate %myvar DescriptorSet 0 +OpDecorate %myvar Binding 0 +OpDecorate %_struct_3 Block +OpMemberDecorate %_struct_3 0 MatrixStride 64 +OpMemberDecorate %_struct_3 0 Offset 0 +%void = OpTypeVoid +%5 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v2float = OpTypeVector %float 2 +%mat3v2float = OpTypeMatrix %v2float 3 +%_struct_3 = OpTypeStruct %mat3v2float +%_ptr_StorageBuffer__struct_3 = OpTypePointer StorageBuffer %_struct_3 +%myvar = OpVariable %_ptr_StorageBuffer__struct_3 StorageBuffer +%1 = OpFunction %void None %5 +%10 = OpLabel +OpReturn +OpFunctionEnd + diff --git a/test/unittest/reader/spirv/SpvModuleScopeVarParserTest_MatrixStrideDecoration_Natural_Dropped.spvasm b/test/unittest/reader/spirv/SpvModuleScopeVarParserTest_MatrixStrideDecoration_Natural_Dropped.spvasm new file mode 100644 index 0000000000..5846fb909c --- /dev/null +++ b/test/unittest/reader/spirv/SpvModuleScopeVarParserTest_MatrixStrideDecoration_Natural_Dropped.spvasm @@ -0,0 +1,29 @@ +; Test: SpvModuleScopeVarParserTest_MatrixStrideDecoration_Natural_Dropped.spvasm +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 11 +; Schema: 0 +OpCapability Shader +OpMemoryModel Logical Simple +OpEntryPoint Fragment %1 "main" +OpExecutionMode %1 OriginUpperLeft +OpName %myvar "myvar" +OpDecorate %myvar DescriptorSet 0 +OpDecorate %myvar Binding 0 +OpDecorate %_struct_3 Block +OpMemberDecorate %_struct_3 0 MatrixStride 8 +OpMemberDecorate %_struct_3 0 Offset 0 +%void = OpTypeVoid +%5 = OpTypeFunction %void +%float = OpTypeFloat 32 +%v2float = OpTypeVector %float 2 +%mat3v2float = OpTypeMatrix %v2float 3 +%_struct_3 = OpTypeStruct %mat3v2float +%_ptr_StorageBuffer__struct_3 = OpTypePointer StorageBuffer %_struct_3 +%myvar = OpVariable %_ptr_StorageBuffer__struct_3 StorageBuffer +%1 = OpFunction %void None %5 +%10 = OpLabel +OpReturn +OpFunctionEnd + diff --git a/test/unittest/reader/spirv/SpvParserCFGTest_ClassifyCFGEdges_LoopBreak_FromContinueConstructHeader.spvasm b/test/unittest/reader/spirv/SpvParserCFGTest_ClassifyCFGEdges_LoopBreak_FromContinueConstructHeader.spvasm new file mode 100644 index 0000000000..ab5edb7fa9 --- /dev/null +++ b/test/unittest/reader/spirv/SpvParserCFGTest_ClassifyCFGEdges_LoopBreak_FromContinueConstructHeader.spvasm @@ -0,0 +1,53 @@ +; Test: SpvParserCFGTest_ClassifyCFGEdges_LoopBreak_FromContinueConstructHeader.spvasm +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 1000 +; Schema: 0 +OpCapability Shader +OpMemoryModel Logical Simple +OpEntryPoint Fragment %100 "main" +OpExecutionMode %100 OriginUpperLeft +OpName %var "var" +%void = OpTypeVoid +%3 = OpTypeFunction %void +%bool = OpTypeBool +%5 = OpConstantNull %bool +%true = OpConstantTrue %bool +%false = OpConstantFalse %bool +%uint = OpTypeInt 32 0 +%int = OpTypeInt 32 1 +%uint_42 = OpConstant %uint 42 +%int_42 = OpConstant %int 42 +%13 = OpTypeFunction %uint +%uint_0 = OpConstant %uint 0 +%uint_1 = OpConstant %uint 1 +%uint_2 = OpConstant %uint 2 +%uint_3 = OpConstant %uint 3 +%uint_4 = OpConstant %uint 4 +%uint_5 = OpConstant %uint 5 +%uint_6 = OpConstant %uint 6 +%uint_7 = OpConstant %uint 7 +%uint_8 = OpConstant %uint 8 +%uint_10 = OpConstant %uint 10 +%uint_20 = OpConstant %uint 20 +%uint_30 = OpConstant %uint 30 +%uint_40 = OpConstant %uint 40 +%uint_50 = OpConstant %uint 50 +%uint_90 = OpConstant %uint 90 +%uint_99 = OpConstant %uint 99 +%_ptr_Private_uint = OpTypePointer Private %uint +%var = OpVariable %_ptr_Private_uint Private +%uint_999 = OpConstant %uint 999 +%100 = OpFunction %void None %3 +%10 = OpLabel +OpBranch %20 +%20 = OpLabel +OpLoopMerge %99 %30 None +OpBranchConditional %5 %30 %99 +%30 = OpLabel +OpBranchConditional %true %20 %99 +%99 = OpLabel +OpReturn +OpFunctionEnd + diff --git a/test/unittest/reader/spirv/SpvParserCFGTest_ClassifyCFGEdges_LoopBreak_FromContinueConstructTail.spvasm b/test/unittest/reader/spirv/SpvParserCFGTest_ClassifyCFGEdges_LoopBreak_FromContinueConstructTail.spvasm new file mode 100644 index 0000000000..164b376b6e --- /dev/null +++ b/test/unittest/reader/spirv/SpvParserCFGTest_ClassifyCFGEdges_LoopBreak_FromContinueConstructTail.spvasm @@ -0,0 +1,57 @@ +; Test: SpvParserCFGTest_ClassifyCFGEdges_LoopBreak_FromContinueConstructTail.spvasm +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 1000 +; Schema: 0 +OpCapability Shader +OpMemoryModel Logical Simple +OpEntryPoint Fragment %100 "main" +OpExecutionMode %100 OriginUpperLeft +OpName %var "var" +%void = OpTypeVoid +%3 = OpTypeFunction %void +%bool = OpTypeBool +%5 = OpConstantNull %bool +%true = OpConstantTrue %bool +%false = OpConstantFalse %bool +%uint = OpTypeInt 32 0 +%int = OpTypeInt 32 1 +%uint_42 = OpConstant %uint 42 +%int_42 = OpConstant %int 42 +%13 = OpTypeFunction %uint +%uint_0 = OpConstant %uint 0 +%uint_1 = OpConstant %uint 1 +%uint_2 = OpConstant %uint 2 +%uint_3 = OpConstant %uint 3 +%uint_4 = OpConstant %uint 4 +%uint_5 = OpConstant %uint 5 +%uint_6 = OpConstant %uint 6 +%uint_7 = OpConstant %uint 7 +%uint_8 = OpConstant %uint 8 +%uint_10 = OpConstant %uint 10 +%uint_20 = OpConstant %uint 20 +%uint_30 = OpConstant %uint 30 +%uint_40 = OpConstant %uint 40 +%uint_50 = OpConstant %uint 50 +%uint_90 = OpConstant %uint 90 +%uint_99 = OpConstant %uint 99 +%_ptr_Private_uint = OpTypePointer Private %uint +%var = OpVariable %_ptr_Private_uint Private +%uint_999 = OpConstant %uint 999 +%100 = OpFunction %void None %3 +%10 = OpLabel +OpBranch %20 +%20 = OpLabel +OpLoopMerge %99 %50 None +OpBranchConditional %5 %30 %99 +%30 = OpLabel +OpBranch %50 +%50 = OpLabel +OpBranch %60 +%60 = OpLabel +OpBranchConditional %true %20 %99 +%99 = OpLabel +OpReturn +OpFunctionEnd + diff --git a/test/unittest/reader/spirv/SpvParserCFGTest_ComputeBlockOrder_Loop_Continue_HasBreakIf.spvasm b/test/unittest/reader/spirv/SpvParserCFGTest_ComputeBlockOrder_Loop_Continue_HasBreakIf.spvasm new file mode 100644 index 0000000000..d2842039c0 --- /dev/null +++ b/test/unittest/reader/spirv/SpvParserCFGTest_ComputeBlockOrder_Loop_Continue_HasBreakIf.spvasm @@ -0,0 +1,55 @@ +; Test: SpvParserCFGTest_ComputeBlockOrder_Loop_Continue_HasBreakIf.spvasm +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 1000 +; Schema: 0 +OpCapability Shader +OpMemoryModel Logical Simple +OpEntryPoint Fragment %100 "main" +OpExecutionMode %100 OriginUpperLeft +OpName %var "var" +%void = OpTypeVoid +%3 = OpTypeFunction %void +%bool = OpTypeBool +%5 = OpConstantNull %bool +%true = OpConstantTrue %bool +%false = OpConstantFalse %bool +%uint = OpTypeInt 32 0 +%int = OpTypeInt 32 1 +%uint_42 = OpConstant %uint 42 +%int_42 = OpConstant %int 42 +%13 = OpTypeFunction %uint +%uint_0 = OpConstant %uint 0 +%uint_1 = OpConstant %uint 1 +%uint_2 = OpConstant %uint 2 +%uint_3 = OpConstant %uint 3 +%uint_4 = OpConstant %uint 4 +%uint_5 = OpConstant %uint 5 +%uint_6 = OpConstant %uint 6 +%uint_7 = OpConstant %uint 7 +%uint_8 = OpConstant %uint 8 +%uint_10 = OpConstant %uint 10 +%uint_20 = OpConstant %uint 20 +%uint_30 = OpConstant %uint 30 +%uint_40 = OpConstant %uint 40 +%uint_50 = OpConstant %uint 50 +%uint_90 = OpConstant %uint 90 +%uint_99 = OpConstant %uint 99 +%_ptr_Private_uint = OpTypePointer Private %uint +%var = OpVariable %_ptr_Private_uint Private +%uint_999 = OpConstant %uint 999 +%100 = OpFunction %void None %3 +%10 = OpLabel +OpBranch %20 +%20 = OpLabel +OpLoopMerge %99 %50 None +OpBranchConditional %5 %30 %99 +%30 = OpLabel +OpBranch %50 +%50 = OpLabel +OpBranchConditional %true %99 %20 +%99 = OpLabel +OpReturn +OpFunctionEnd + diff --git a/test/unittest/reader/spirv/SpvParserCFGTest_ComputeBlockOrder_Loop_Continue_HasBreakUnless.spvasm b/test/unittest/reader/spirv/SpvParserCFGTest_ComputeBlockOrder_Loop_Continue_HasBreakUnless.spvasm new file mode 100644 index 0000000000..346045fa06 --- /dev/null +++ b/test/unittest/reader/spirv/SpvParserCFGTest_ComputeBlockOrder_Loop_Continue_HasBreakUnless.spvasm @@ -0,0 +1,55 @@ +; Test: SpvParserCFGTest_ComputeBlockOrder_Loop_Continue_HasBreakUnless.spvasm +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 1000 +; Schema: 0 +OpCapability Shader +OpMemoryModel Logical Simple +OpEntryPoint Fragment %100 "main" +OpExecutionMode %100 OriginUpperLeft +OpName %var "var" +%void = OpTypeVoid +%3 = OpTypeFunction %void +%bool = OpTypeBool +%5 = OpConstantNull %bool +%true = OpConstantTrue %bool +%false = OpConstantFalse %bool +%uint = OpTypeInt 32 0 +%int = OpTypeInt 32 1 +%uint_42 = OpConstant %uint 42 +%int_42 = OpConstant %int 42 +%13 = OpTypeFunction %uint +%uint_0 = OpConstant %uint 0 +%uint_1 = OpConstant %uint 1 +%uint_2 = OpConstant %uint 2 +%uint_3 = OpConstant %uint 3 +%uint_4 = OpConstant %uint 4 +%uint_5 = OpConstant %uint 5 +%uint_6 = OpConstant %uint 6 +%uint_7 = OpConstant %uint 7 +%uint_8 = OpConstant %uint 8 +%uint_10 = OpConstant %uint 10 +%uint_20 = OpConstant %uint 20 +%uint_30 = OpConstant %uint 30 +%uint_40 = OpConstant %uint 40 +%uint_50 = OpConstant %uint 50 +%uint_90 = OpConstant %uint 90 +%uint_99 = OpConstant %uint 99 +%_ptr_Private_uint = OpTypePointer Private %uint +%var = OpVariable %_ptr_Private_uint Private +%uint_999 = OpConstant %uint 999 +%100 = OpFunction %void None %3 +%10 = OpLabel +OpBranch %20 +%20 = OpLabel +OpLoopMerge %99 %50 None +OpBranchConditional %5 %30 %99 +%30 = OpLabel +OpBranch %50 +%50 = OpLabel +OpBranchConditional %true %20 %99 +%99 = OpLabel +OpReturn +OpFunctionEnd + diff --git a/test/unittest/reader/spirv/SpvParserTest_Composite_Construct_ConstantComposite_Struct_NoDeduplication.spvasm b/test/unittest/reader/spirv/SpvParserTest_Composite_Construct_ConstantComposite_Struct_NoDeduplication.spvasm new file mode 100644 index 0000000000..7f9fc3fc0d --- /dev/null +++ b/test/unittest/reader/spirv/SpvParserTest_Composite_Construct_ConstantComposite_Struct_NoDeduplication.spvasm @@ -0,0 +1,51 @@ +; Test: SpvParserTest_Composite_Construct_ConstantComposite_Struct_NoDeduplication.spvasm +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 302 +; Schema: 0 +OpCapability Shader +OpMemoryModel Logical Simple +OpEntryPoint GLCompute %100 "main" +OpExecutionMode %100 LocalSize 1 1 1 +%void = OpTypeVoid +%4 = OpTypeFunction %void +%uint = OpTypeInt 32 0 +%int = OpTypeInt 32 1 +%float = OpTypeFloat 32 +%uint_10 = OpConstant %uint 10 +%uint_20 = OpConstant %uint 20 +%uint_3 = OpConstant %uint 3 +%uint_4 = OpConstant %uint 4 +%uint_5 = OpConstant %uint 5 +%int_1 = OpConstant %int 1 +%int_30 = OpConstant %int 30 +%int_40 = OpConstant %int 40 +%float_50 = OpConstant %float 50 +%float_60 = OpConstant %float 60 +%float_70 = OpConstant %float 70 +%v2uint = OpTypeVector %uint 2 +%v3uint = OpTypeVector %uint 3 +%v4uint = OpTypeVector %uint 4 +%v2int = OpTypeVector %int 2 +%v2float = OpTypeVector %float 2 +%mat3v2float = OpTypeMatrix %v2float 3 +%25 = OpConstantNull %mat3v2float +%_struct_26 = OpTypeStruct %v2float %uint %int +%_arr_uint_uint_5 = OpTypeArray %uint %uint_5 +%28 = OpConstantComposite %v2uint %uint_3 %uint_4 +%29 = OpConstantComposite %v2uint %uint_4 %uint_3 +%30 = OpConstantComposite %v2float %float_50 %float_60 +%31 = OpConstantComposite %v2float %float_60 %float_50 +%32 = OpConstantComposite %v2float %float_70 %float_70 +%_struct_200 = OpTypeStruct %uint +%_struct_300 = OpTypeStruct %uint +%201 = OpConstantComposite %_struct_200 %uint_10 +%301 = OpConstantComposite %_struct_300 %uint_10 +%100 = OpFunction %void None %4 +%33 = OpLabel +%2 = OpCopyObject %_struct_200 %201 +%3 = OpCopyObject %_struct_300 %301 +OpReturn +OpFunctionEnd + diff --git a/test/unittest/reader/spirv/SpvParserTest_ConvertType_Array_NoDeduplication.spvasm b/test/unittest/reader/spirv/SpvParserTest_ConvertType_Array_NoDeduplication.spvasm new file mode 100644 index 0000000000..5f5651271b --- /dev/null +++ b/test/unittest/reader/spirv/SpvParserTest_ConvertType_Array_NoDeduplication.spvasm @@ -0,0 +1,23 @@ +; Test: SpvParserTest_ConvertType_Array_NoDeduplication.spvasm +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 22 +; Schema: 0 +OpCapability Shader +OpMemoryModel Logical Simple +OpEntryPoint Fragment %1 "x_100" +OpExecutionMode %1 OriginUpperLeft +%uint = OpTypeInt 32 0 +%_struct_10 = OpTypeStruct %uint +%_struct_11 = OpTypeStruct %uint +%uint_1 = OpConstant %uint 1 +%_arr__struct_10_uint_1 = OpTypeArray %_struct_10 %uint_1 +%_arr__struct_11_uint_1 = OpTypeArray %_struct_11 %uint_1 +%void = OpTypeVoid +%5 = OpTypeFunction %void +%1 = OpFunction %void None %5 +%6 = OpLabel +OpReturn +OpFunctionEnd + diff --git a/test/unittest/reader/spirv/SpvParserTest_ConvertType_RuntimeArray_NoDeduplication.spvasm b/test/unittest/reader/spirv/SpvParserTest_ConvertType_RuntimeArray_NoDeduplication.spvasm new file mode 100644 index 0000000000..59059e0ecf --- /dev/null +++ b/test/unittest/reader/spirv/SpvParserTest_ConvertType_RuntimeArray_NoDeduplication.spvasm @@ -0,0 +1,23 @@ +; Test: SpvParserTest_ConvertType_RuntimeArray_NoDeduplication.spvasm +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 23 +; Schema: 0 +OpCapability Shader +OpMemoryModel Logical Simple +OpEntryPoint Fragment %1 "x_100" +OpExecutionMode %1 OriginUpperLeft +%uint = OpTypeInt 32 0 +%_struct_10 = OpTypeStruct %uint +%_struct_11 = OpTypeStruct %uint +%_runtimearr__struct_10 = OpTypeRuntimeArray %_struct_10 +%_runtimearr__struct_11 = OpTypeRuntimeArray %_struct_11 +%_runtimearr__struct_10_0 = OpTypeRuntimeArray %_struct_10 +%void = OpTypeVoid +%4 = OpTypeFunction %void +%1 = OpFunction %void None %4 +%5 = OpLabel +OpReturn +OpFunctionEnd + diff --git a/test/unittest/reader/spirv/SpvParserTest_ConvertType_Struct_NoDeduplication.spvasm b/test/unittest/reader/spirv/SpvParserTest_ConvertType_Struct_NoDeduplication.spvasm new file mode 100644 index 0000000000..9caeb7de7f --- /dev/null +++ b/test/unittest/reader/spirv/SpvParserTest_ConvertType_Struct_NoDeduplication.spvasm @@ -0,0 +1,20 @@ +; Test: SpvParserTest_ConvertType_Struct_NoDeduplication.spvasm +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 12 +; Schema: 0 +OpCapability Shader +OpMemoryModel Logical Simple +OpEntryPoint Fragment %1 "x_100" +OpExecutionMode %1 OriginUpperLeft +%uint = OpTypeInt 32 0 +%_struct_10 = OpTypeStruct %uint +%_struct_11 = OpTypeStruct %uint +%void = OpTypeVoid +%4 = OpTypeFunction %void +%1 = OpFunction %void None %4 +%5 = OpLabel +OpReturn +OpFunctionEnd + diff --git a/test/unittest/reader/spirv/SpvParserTest_GlslStd450_Ldexp_Scalar_Float_Uint.spvasm b/test/unittest/reader/spirv/SpvParserTest_GlslStd450_Ldexp_Scalar_Float_Uint.spvasm new file mode 100644 index 0000000000..78a43b8c89 --- /dev/null +++ b/test/unittest/reader/spirv/SpvParserTest_GlslStd450_Ldexp_Scalar_Float_Uint.spvasm @@ -0,0 +1,92 @@ +; Test: SpvParserTest_GlslStd450_Ldexp_Scalar_Float_Uint.spvasm +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 101 +; Schema: 0 +OpCapability Shader +%2 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint GLCompute %100 "main" +OpExecutionMode %100 LocalSize 1 1 1 +OpName %u1 "u1" +OpName %u2 "u2" +OpName %u3 "u3" +OpName %i1 "i1" +OpName %i2 "i2" +OpName %i3 "i3" +OpName %f1 "f1" +OpName %f2 "f2" +OpName %f3 "f3" +OpName %v2u1 "v2u1" +OpName %v2u2 "v2u2" +OpName %v2u3 "v2u3" +OpName %v2i1 "v2i1" +OpName %v2i2 "v2i2" +OpName %v2i3 "v2i3" +OpName %v2f1 "v2f1" +OpName %v2f2 "v2f2" +OpName %v2f3 "v2f3" +OpName %v3f1 "v3f1" +OpName %v3f2 "v3f2" +OpName %v4f1 "v4f1" +OpName %v4f2 "v4f2" +%void = OpTypeVoid +%26 = OpTypeFunction %void +%uint = OpTypeInt 32 0 +%int = OpTypeInt 32 1 +%float = OpTypeFloat 32 +%uint_10 = OpConstant %uint 10 +%uint_15 = OpConstant %uint 15 +%uint_20 = OpConstant %uint 20 +%int_30 = OpConstant %int 30 +%int_35 = OpConstant %int 35 +%int_40 = OpConstant %int 40 +%float_50 = OpConstant %float 50 +%float_60 = OpConstant %float 60 +%float_70 = OpConstant %float 70 +%v2uint = OpTypeVector %uint 2 +%v2int = OpTypeVector %int 2 +%v2float = OpTypeVector %float 2 +%v3float = OpTypeVector %float 3 +%v4float = OpTypeVector %float 4 +%44 = OpConstantComposite %v2uint %uint_10 %uint_20 +%45 = OpConstantComposite %v2uint %uint_20 %uint_10 +%46 = OpConstantComposite %v2uint %uint_15 %uint_15 +%47 = OpConstantComposite %v2int %int_30 %int_40 +%48 = OpConstantComposite %v2int %int_40 %int_30 +%49 = OpConstantComposite %v2int %int_35 %int_35 +%50 = OpConstantComposite %v2float %float_50 %float_60 +%51 = OpConstantComposite %v2float %float_60 %float_50 +%52 = OpConstantComposite %v2float %float_70 %float_70 +%53 = OpConstantComposite %v3float %float_50 %float_60 %float_70 +%54 = OpConstantComposite %v3float %float_60 %float_70 %float_50 +%55 = OpConstantComposite %v4float %float_50 %float_50 %float_50 %float_50 +%100 = OpFunction %void None %26 +%56 = OpLabel +%u1 = OpCopyObject %uint %uint_10 +%u2 = OpCopyObject %uint %uint_15 +%u3 = OpCopyObject %uint %uint_20 +%i1 = OpCopyObject %int %int_30 +%i2 = OpCopyObject %int %int_35 +%i3 = OpCopyObject %int %int_40 +%f1 = OpCopyObject %float %float_50 +%f2 = OpCopyObject %float %float_60 +%f3 = OpCopyObject %float %float_70 +%v2u1 = OpCopyObject %v2uint %44 +%v2u2 = OpCopyObject %v2uint %45 +%v2u3 = OpCopyObject %v2uint %46 +%v2i1 = OpCopyObject %v2int %47 +%v2i2 = OpCopyObject %v2int %48 +%v2i3 = OpCopyObject %v2int %49 +%v2f1 = OpCopyObject %v2float %50 +%v2f2 = OpCopyObject %v2float %51 +%v2f3 = OpCopyObject %v2float %52 +%v3f1 = OpCopyObject %v3float %53 +%v3f2 = OpCopyObject %v3float %54 +%v4f1 = OpCopyObject %v4float %55 +%v4f2 = OpCopyObject %v4float %v4f1 +%1 = OpExtInst %float %2 Ldexp %f1 %u1 +OpReturn +OpFunctionEnd + diff --git a/test/unittest/reader/spirv/SpvParserTest_GlslStd450_Ldexp_Vector_Floatvec_Uintvec.spvasm b/test/unittest/reader/spirv/SpvParserTest_GlslStd450_Ldexp_Vector_Floatvec_Uintvec.spvasm new file mode 100644 index 0000000000..532dc70236 --- /dev/null +++ b/test/unittest/reader/spirv/SpvParserTest_GlslStd450_Ldexp_Vector_Floatvec_Uintvec.spvasm @@ -0,0 +1,92 @@ +; Test: SpvParserTest_GlslStd450_Ldexp_Vector_Floatvec_Uintvec.spvasm +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 101 +; Schema: 0 +OpCapability Shader +%2 = OpExtInstImport "GLSL.std.450" +OpMemoryModel Logical GLSL450 +OpEntryPoint GLCompute %100 "main" +OpExecutionMode %100 LocalSize 1 1 1 +OpName %u1 "u1" +OpName %u2 "u2" +OpName %u3 "u3" +OpName %i1 "i1" +OpName %i2 "i2" +OpName %i3 "i3" +OpName %f1 "f1" +OpName %f2 "f2" +OpName %f3 "f3" +OpName %v2u1 "v2u1" +OpName %v2u2 "v2u2" +OpName %v2u3 "v2u3" +OpName %v2i1 "v2i1" +OpName %v2i2 "v2i2" +OpName %v2i3 "v2i3" +OpName %v2f1 "v2f1" +OpName %v2f2 "v2f2" +OpName %v2f3 "v2f3" +OpName %v3f1 "v3f1" +OpName %v3f2 "v3f2" +OpName %v4f1 "v4f1" +OpName %v4f2 "v4f2" +%void = OpTypeVoid +%26 = OpTypeFunction %void +%uint = OpTypeInt 32 0 +%int = OpTypeInt 32 1 +%float = OpTypeFloat 32 +%uint_10 = OpConstant %uint 10 +%uint_15 = OpConstant %uint 15 +%uint_20 = OpConstant %uint 20 +%int_30 = OpConstant %int 30 +%int_35 = OpConstant %int 35 +%int_40 = OpConstant %int 40 +%float_50 = OpConstant %float 50 +%float_60 = OpConstant %float 60 +%float_70 = OpConstant %float 70 +%v2uint = OpTypeVector %uint 2 +%v2int = OpTypeVector %int 2 +%v2float = OpTypeVector %float 2 +%v3float = OpTypeVector %float 3 +%v4float = OpTypeVector %float 4 +%44 = OpConstantComposite %v2uint %uint_10 %uint_20 +%45 = OpConstantComposite %v2uint %uint_20 %uint_10 +%46 = OpConstantComposite %v2uint %uint_15 %uint_15 +%47 = OpConstantComposite %v2int %int_30 %int_40 +%48 = OpConstantComposite %v2int %int_40 %int_30 +%49 = OpConstantComposite %v2int %int_35 %int_35 +%50 = OpConstantComposite %v2float %float_50 %float_60 +%51 = OpConstantComposite %v2float %float_60 %float_50 +%52 = OpConstantComposite %v2float %float_70 %float_70 +%53 = OpConstantComposite %v3float %float_50 %float_60 %float_70 +%54 = OpConstantComposite %v3float %float_60 %float_70 %float_50 +%55 = OpConstantComposite %v4float %float_50 %float_50 %float_50 %float_50 +%100 = OpFunction %void None %26 +%56 = OpLabel +%u1 = OpCopyObject %uint %uint_10 +%u2 = OpCopyObject %uint %uint_15 +%u3 = OpCopyObject %uint %uint_20 +%i1 = OpCopyObject %int %int_30 +%i2 = OpCopyObject %int %int_35 +%i3 = OpCopyObject %int %int_40 +%f1 = OpCopyObject %float %float_50 +%f2 = OpCopyObject %float %float_60 +%f3 = OpCopyObject %float %float_70 +%v2u1 = OpCopyObject %v2uint %44 +%v2u2 = OpCopyObject %v2uint %45 +%v2u3 = OpCopyObject %v2uint %46 +%v2i1 = OpCopyObject %v2int %47 +%v2i2 = OpCopyObject %v2int %48 +%v2i3 = OpCopyObject %v2int %49 +%v2f1 = OpCopyObject %v2float %50 +%v2f2 = OpCopyObject %v2float %51 +%v2f3 = OpCopyObject %v2float %52 +%v3f1 = OpCopyObject %v3float %53 +%v3f2 = OpCopyObject %v3float %54 +%v4f1 = OpCopyObject %v4float %55 +%v4f2 = OpCopyObject %v4float %v4f1 +%1 = OpExtInst %v2float %2 Ldexp %v2f1 %v2u1 +OpReturn +OpFunctionEnd +